angular/aio/content/examples/i18n/src/app/app.component.ts
2017-07-31 11:38:17 -07:00

22 lines
502 B
TypeScript

// #docregion
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html'
})
export class AppComponent {
wolves = 0;
gender = 'f';
fly = true;
logo = 'https://angular.io/assets/images/logos/angular/angular.png';
count = 3;
heroes: string[] = ['Magneta', 'Celeritas', 'Dynama'];
inc(i: number) {
this.wolves = Math.min(5, Math.max(0, this.wolves + i));
}
male() { this.gender = 'm'; }
female() { this.gender = 'f'; }
}