How can you project content from a parent component into a child component's template?
- Using structural directives like *ngFor.
- Using input properties.
- Using the ViewChild decorator.
- Using Angular modules.
You can project content from a parent component into a child component's template using structural directives like *ngFor, *ngIf, etc. These directives allow you to conditionally render or iterate over content in the child component's template based on data passed from the parent. Input properties are used to pass data, but they don't project content in this way. The other options are not related to content projection.
Loading...
Related Quiz
- Which directive is used to create a custom attribute in Angular?
- Your application has a dynamic form where fields can be added or removed based on user input. Which feature of Angular's Reactive Forms would you leverage to accomplish this?
- What's the primary use of the Renderer2 class in custom directives?
- You're building a carousel component that requires initialization logic after its views are rendered. Which lifecycle hook would be most appropriate for this?
- What is the primary use of the HttpClient module in Angular?