import { Component } from '@angular/core';
import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
@Component({
selector: 'ng-switch-sample-app',
template: `
- First choice
- Second choice
- Third choice
- Fourth choice
- Second choice, again
- Default choice
`
})
export class NgSwitchSampleApp {
choice: number;
constructor() {
this.choice = 1;
}
nextChoice() {
this.choice += 1;
if (this.choice > 5) {
this.choice = 1;
}
}
}
@NgModule({
declarations: [ NgSwitchSampleApp ],
exports: [ NgSwitchSampleApp ],
imports: [ BrowserModule ]
})
export class NgSwitchSampleAppModule {}