Reputation: 489
Here is my code. credit.creditSum - this is number I'm sure. I tried this in firefox and it works. But in chrome not.
<div *ngIf="credit" class="row">
<div class="span-12">
<!-- table content 1 -->
<div class="head_1">
<span class="title_1">{{credit.id}}</span>
<span class="title_summ">{{credit.creditSum | currency:'USD':true}}</span>
<span class="title_ccy">EUR</span>
</div>
<!-- end table content 1 -->
</div>
</div>
Here is an error
EXCEPTION: TypeError: Cannot redefine property: length in [{{credit.creditSum | currency:'USD':true}} in CreditDetailsComponent@25:33] browser_adapter.ts:73
ORIGINAL EXCEPTION: TypeError: Cannot redefine property: length browser_adapter.ts:73
ORIGINAL STACKTRACE: browser_adapter.ts:73
TypeError: Cannot redefine property: length
at defineProperty (native)
Upvotes: 3
Views: 833
Reputation: 657691
Works fine for me https://plnkr.co/edit/DfiZubmdsh5eaI6rkCGy?p=preview The error is obviously not with the currency pipe.
@Component({
selector: 'my-app',
providers: [],
template: `
<div>
<h2>Hello {{name}}</h2>
<span class="title_summ">{{credit.creditSum | currency:'USD':true}}</span>
`,
directives: []
})
export class App {
credit = {creditSum: 10};
constructor() {
this.name = 'Angular2'
}
}
Upvotes: 2