Created
September 9, 2019 10:47
-
-
Save Mayankgupta688/86cc2ea1000605e7e04edb6d1b365969 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" #userName /> | |
<input type="text" #userAge /> | |
<input type="text" #userDesignation /> | |
</div> | |
` | |
}) | |
export class HeroListComponent implements OnInit { | |
@ViewChildren("userName, userAge, userDesignation") userInfoReference: QueryList<NgModel>; | |
ngAfterViewInit(): void { | |
console.log("Element List: " + this.userInfoReference.length); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment