Last active
June 26, 2020 17:53
-
-
Save Mayankgupta688/db14a303c3f94ee2c85b89b1992ace9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'accessing-template-reference', | |
template: ` | |
<div> | |
<input type="text" id="userName" [(ngModel)]="userName" /> | |
</div> | |
` | |
}) | |
export class HeroListComponent implements OnInit { | |
@ViewChild(NgModel) userNameReference: NgModel; | |
ngAfterViewInit(): void { | |
this.userNameReference.valueChanges.subscribe( | |
() => { this.executeOtherFunction() } | |
) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"this.userNameReference,valueChanges.subscribe" > "this.userNameReference.valueChanges.subscribe"