export class BankAccount implements OnChanges{ ngOnChanges(changes: SimpleChanges): void { /*console.log('ngOnChanges triggered: ' + changes.bankName.currentValue + ' previous value: ' + changes.bankName.previousValue);*/ } // This property is bound using its original name. /* @Input() set bankName(newName) { console.log('bankName new value set: ' + newName); }*/ @Input() bankName:string; // this property value is bound to a different property name // when this component is instantiated in a template. @Input('account-id') id: string; // this property is not bound, and is not automatically updated by Angular normalizedBankName: string; } @Component({ selector: 'app', template: ` <bank-account [bankName]="bankName" account-id="4747"></bank-account> ` }) export class App implements OnInit, AfterViewInit{ _bankName = 'Jerry'; ngAfterViewInit(): void { this._bankName = 'Jerry2'; } get bankName(){ return this._bankName; } ngOnInit(): void { } }