Skip to main content

Difference between embedded views and host views?

Mid Angular
Quick Answer Embedded view: created from a TemplateRef (ng-template) - renders a reusable template chunk into the DOM. Host view: the view of a dynamically created component (ComponentRef.hostView). Both are ViewRef instances and can be attached to a ViewContainerRef. Structural directives use embedded views: *ngIf creates/destroys an embedded view for the ng-template content.

Answer

Host views belong to components.
Embedded views are created from ng-template or structural directives.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice