ng2 - Difference between ng-container and ng-template tags

前端 未结 7 989
温柔的废话
温柔的废话 2020-12-01 00:15

Can someone please illustrate the difference between using and elements?

I could not find document

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 00:54

    In simple terms, ng-container is like a Higher component of React, which only aids in the rendering of its child elements.

    ng-template is basically for internal implementation of Angular, wherein anything inside the ng-template is completely ignored while rendering and it basically becomes a comment on view source. This is supposed to be used with Angular's internal directives like ngIf, ngSwitch etc.

提交回复
热议问题