VadimDez / ngx-order-pipe

▼ Angular 5+ orderBy pipe
https://vadimdez.github.io/ngx-order-pipe/
MIT License
243 stars 57 forks source link

No provider for OrderPipe when using it in a component #64

Closed tomobrien2004 closed 5 years ago

tomobrien2004 commented 6 years ago

I'm getting the following error in the console when I use the OrderPipe in my component:

Uncaught (in promise): Error: StaticInjectorError(AppModule)[CategoryListComponent -> OrderPipe]: StaticInjectorError(Platform: core)[CategoryListComponent -> OrderPipe]: NullInjectorError: No provider for OrderPipe! Error: StaticInjectorError(AppModule)[CategoryListComponent -> OrderPipe]: StaticInjectorError(Platform: core)[CategoryListComponent -> OrderPipe]: NullInjectorError: No provider for OrderPipe!

I have imported the OrderPipe into the component like this:

import { OrderPipe } from 'ngx-order-pipe';

And injected it in the constructor like this:

constructor(private orderPipe: OrderPipe) { }

The OrderModule has been imported into the app-module.ts like so:

import { OrderModule } from 'ngx-order-pipe';

And it has been listed as an import in the @ngModule like thus:

imports: [ OrderModule]

I'm using angular 5.6.0 and ngx-order-pipe 1.1.3.

Any thoughts?

VadimDez commented 6 years ago

Could you try the latest version of ngx-order-pipe or at least 1.2.1?