utiq
utiq

Reputation: 1381

The 'pipe' number cannot be found

I just migrated my app from angular 4 to 7, everything works fine, but when it's moment to compile (ng build --prod), I get this error:

ERROR in : Template parse errors:
The pipe 'number' could not be found ("
      </div>
      <div class="col-2">
        {{ listing.currency.abbreviation[ERROR ->]() }}{{ totalCreditRequest() | number : '1.0-1' }}
        <span class="status-badge {{ claims[claims"): /Users/../claims/claims.component.html@50:40
The pipe 'number' could not be found ("m.itemLot.grade }}</td>
            <td class="text-center">{{ listing.currency.abbreviation() }}{{ [ERROR ->]claim.outcomeValue | number : '1.0-1' }}</td>
            <td class="text-center">{{ claim.issue.name"): /Users/../claims/claims.component.html@82:76

UPDATE

I found out that it was not compiling because of this, can someone explain to me how ivy works and why it's not compiling? I changed it to false and it works now.

"angularCompilerOptions": {
  "enableIvy": true
}

Upvotes: 3

Views: 2637

Answers (2)

utiq
utiq

Reputation: 1381

If you have able enabled it won't work

"angularCompilerOptions": { "enableIvy": false }

Upvotes: 0

Severin Klug
Severin Klug

Reputation: 754

You have to import CommonModule, it covers the DecimalPipe

https://angular.io/api/common/CommonModule

import { CommonModule } from '@angular/common';

@NgModule({
  imports: [
    CommonModule,
    ...
  ],
  providers: [...],
  declarations: [...]
})
export class YourModule {}

Upvotes: 1

Related Questions