Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
}
like image 717
utiq Avatar asked Apr 01 '26 08:04

utiq


1 Answers

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 {}
like image 184
Severin Klug Avatar answered Apr 02 '26 23:04

Severin Klug



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!