Equivalent of $compile in Angular 2

后端 未结 9 839
名媛妹妹
名媛妹妹 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:22

    Angular TypeScript/ES6 (Angular 2+)

    Works with AOT + JIT at once together.

    I created how to use it here: https://github.com/patrikx3/angular-compile

    npm install p3x-angular-compile
    

    Component: Should have a context and some html data...

    Html:

    loading ...

提交回复
热议问题