Writing on Angular platform engineering, software architecture, team leadership, and the Linux desktop. Six reading paths cover Angular, leadership, systems, frontend quality, AI & data tools, and architecture — plus ordered series on the Series index. Browse topics by tag or scroll the chronological archive.
ViewChild Angular: Complete Guide to @ViewChild and @ContentChild
Angular’s @ViewChild and @ContentChild decorators provide a powerful way to interact with child components, DOM elements, and projected content within a component’s template. While they are often misunderstood or used interchangeably, each has its own specific purpose and use cases. In this comprehensive guide, we’ll dive deep into both decorators, understanding their differences, use cases, and best practices. Additionally, we’ll explore advanced techniques for leveraging them in various scenarios and edge cases, complete with sample code for hands-on understanding. ...