Using DirectiveResolver to alter @Component metadata

后端 未结 1 1993
广开言路
广开言路 2021-01-21 14:33

I am wondering how to use the DirectiveResolver object to alter a given Component.

Dependencies (ng2 moves so fast these days things become obs

相关标签:
1条回答
  • 2021-01-21 14:47

    You need to pass extra providers by bootstrapping application to override default compiler providers.

    So i think this should work:

    platformBrowserDynamic().bootstrapModule(AppModule, { 
      providers: [
        { provide: DirectiveResolver, useClass: myViewResolver } 
      ]
    });
    

    Plunker Example

    0 讨论(0)
提交回复
热议问题