Last active
March 13, 2021 19:32
-
-
Save Mayankgupta688/e75b17c94b7fa34486913a353a451cb9 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> | |
<user-details [userId]="firstUser"></user-details> | |
<user-details [userId]="secondUser"></user-details> | |
<user-details [userId]="thirdUser"></user-details> | |
</div> | |
` | |
}) | |
export class HeroListComponent implements OnInit { | |
@ViewChildren("UserDetailComponent") userDetailReferences: QueryList<NgModel>; | |
ngAfterViewInit(): void { | |
console.log("Element List: " + this.userDetailReferences.length); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you, it's great for an absolute beginner like me.