The pipe ' ' could not be found angular2 custom pipe

后端 未结 9 1110
时光说笑
时光说笑 2020-11-27 14:33

I can\'t seem to fix this error. I have a search bar and an ngFor. I am trying to filter the array using a custom pipe like this:



        
9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 14:46

    If you see this error when running tests, make sure you have imported the module the pipe belongs to, e.g.:

        beforeEach(async(() => {
            TestBed.configureTestingModule({
                imports: [CustomPipeModule],
                declarations: [...],
                providers: [...],
                ...
            }).compileComponents();
        }));
    

提交回复
热议问题