The pipe 'safeResourceUrl' could not be found

后端 未结 1 1667
孤街浪徒
孤街浪徒 2021-01-22 21:24

Working on solving some security errors since I\'m trying to dynamically embed youtube videos into my Angular 2 app. Found this answer here regarding the use of a Pipe to saniti

相关标签:
1条回答
  • Pipes can't be made available globally. They need to be imported wherever they are used, the same as components or directives.

    @NgModule({
        declarations: [
            SafeResourceUrl
        ],
        imports: [
          CommonModule
        ]
    })
    class SharedModule {
    
    @NgModule({
        declarations: [
          CommonModule,
          HomeComponent,
        ],
        imports: [
            SharedModule,
        ]
    })
    class HomeModule
    
    0 讨论(0)
提交回复
热议问题