TalesMGodois
TalesMGodois

Reputation: 316

The pipe 'ngrxPush' could not be found

I am new to NgRx and I have being learning for the past week.

So, I was trying to check the Push Pipe and let directive.

According to NgRx Documentation the installation of this guy would be using the following command:

yarn add github:ngrx/component-builds.git

My code is the following:

<ons-list-item expandable *ngFor="let user of users$ | ngrxPush">
 <!-- code here -->
</ons-list-item>

Well after that I tried to find the module that I need to import to have this pipe. To have the async pipe i just need to import the CommonModule.

Any Idea what should I import to have this working? Looks like the documentation is not too clear in this part.

Upvotes: 2

Views: 2979

Answers (3)

Dcode22
Dcode22

Reputation: 97

UPDATE: import the PushModule from '@ngrx/component' as below:

import { PushModule } from '@ngrx/component'

In "@ngrx/component": "15.0.0" ReactiveComponentModule seems to have been removed.

Upvotes: 2

Rajat Badjatya
Rajat Badjatya

Reputation: 818

I was facing a similar issue for my unit test.

The pipe 'ngrxPush' could not be found!

The issue was persisting even though I've imported the correct module i.e. ReactiveComponentModule which contains the ngrxPush in spec.ts file.

In my case, the error got resolved when I fixed the mockStore's config(added the missing initialState attribute).

  providers: [
    provideMockStore(
      {
        initialState: {
          changePassword: false
        }
      })
  ]

I believe the stack trace provided by Angular for unit test is misleading.

Upvotes: 0

timdeschryver
timdeschryver

Reputation: 15487

You have to import the ReactiveComponentModule.

import { ReactiveComponentModule } from '@ngrx/component';

docs here

Upvotes: 6

Related Questions