在ngmodule中添加但仍然得到

时间:2018-12-21 13:35:11

标签: javascript angular

enter image description here enter image description here

  

错误:无法在E:/ xampp / ht中确定类SerchPendingPipe的模块   docs / angular_after_merge / source_angular / src / app / pipes / Serch-Pending.pipe.ts!   将SerchPendingPipe添加到NgModule中进行修复。

1 个答案:

答案 0 :(得分:0)

app.module.ts中添加声明数组:

declarations: [SerchPendingPipe]

您的app.module.ts如下:

import { SerchPendingPipe} from 'your_path'; // use control + dot to get the IntelliSense

@NgModule({
  declarations: [
   ..  your components,
    SerchPendingPipe
  ],

  imports: [
    .. Modules
  ],
  providers: [
    .. 
  ]
})
export class AppModule { }