Equivalent of $compile in Angular 2

后端 未结 9 1076
名媛妹妹
名媛妹妹 2020-11-21 06:50

I want to manually compile some HTML containing directives. What is the equivalent of $compile in Angular 2?

For example, in Angular 1, I could dynamic

9条回答
  •  清歌不尽
    2020-11-21 07:01

    If you want to inject html code use directive

    If you want to load whole component in some place, use DynamicComponentLoader:

    https://angular.io/docs/ts/latest/api/core/DynamicComponentLoader-class.html

提交回复
热议问题