Tejashri Patange
Tejashri Patange

Reputation: 339

Angular 2 number pipe gives blank value

I have an angular input as below:

 <input
      #total
      type="number"
      [value]="data['total'] | number : '1.2-2'"
      [step]="1">

The data['total'] is a numeric property. I see blank data when I used the above number pipe. Also the data['total'] has value in it. Cannot actually understand why is it displaying as blank.

Upvotes: 0

Views: 306

Answers (1)

Ragulan
Ragulan

Reputation: 1711

I think problem with data['total'] . Can you explain how you get data data['total']?

if you think problem some problem with the pipe you can try to check something like this to validate the pipe

<input
      #total
      type="number"
      [value]="2.3 | number : '1.2-2'"
      [step]="1">

Upvotes: 1

Related Questions