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