Valeur de modèle de passe angulaire du composant
// Component //
export class MyComponent implements onInit {
// define vars
shownSetting: string;
ngOnInit() {
this.myMethod();
}
myMethod() {
return xyz.length > 0 ? this.shownSetting = "Blue" : this.shownSetting = "Green";
}
}
// Template //
<div>
{{shownSetting}}
</div>
Banana in Transit