0

I have an input bound to an object property and with a filter applied to it.

<input value="{{object.field | filter}}">

The problem is that if I programmatically change object.field, the value displayed inside the input doesn't change, however in the DOM Inspector I see the correct (new) value. I verified to digest/apply the changes to the scope and the object.field variable does change correctly, the issue seems to be only in the input displayed value.

I cannot provide an example since there's too much code involved.

Does anyone know where I should look for errors??

Luca De Nardi
  • 2,280
  • 16
  • 35

2 Answers2

0

No need to set value in that way. ng-model takes care of it. Valid syntax is:

<input ng-model="object.field">

For filtering you can look at this answer: Using angularjs filter in input element

Community
  • 1
  • 1
TreeNode
  • 472
  • 1
  • 7
  • 10
  • Correct me if I'm wrong but unfortunately ng-model can't be used with filters. – Luca De Nardi Jun 15 '15 at 09:09
  • Ye, you right. But you can use $parsers in your controller to filter value. Look at "Using angularjs filter in input element" link in my answer. Good luck! – TreeNode Jun 15 '15 at 09:17
0

I think you should use ng-model to bind your data into input box instead {{expression}}