Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mayankgupta688/88bfd250bffba72a1de745f94bb8cec0 to your computer and use it in GitHub Desktop.
Save Mayankgupta688/88bfd250bffba72a1de745f94bb8cec0 to your computer and use it in GitHub Desktop.
@Component({
selector: 'accessing-template-reference',
template: `
<div>
<input type="text" #applicationInfo />
<input type="text" #applicationInfo />
<input type="text" #applicationInfo />
</div>
`
})
export class HeroListComponent implements OnInit {
@ViewChildren("applicationInfo") applicationInfo: QueryList<NgModel>;
ngAfterViewInit(): void {
console.log("Element List: " + this.applicationInfo.length);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment