5

I'm trying to have a way to catch the change of a variable inside of an ngRepeat so that I can modify other properties. So I have this HTML:

<tr ng-repeat="variable in variables">
  <td>
    <div ng-if="....">
      <textarea ng-model="variable.u_field_values" ng-change="onChange(variable)">

Whenever they modify the text in that textarea, I need to update another value on the current variable that's being used. The change method doesn't seem to ever get fired though.

Scott
  • 163
  • 2
  • 11

1 Answers1

-2

Try putting the ng-change ahead of the ng-model:

<textarea ng-change="onChange(variable)" ng-model="variable.u_field_values">

I have found that order sometimes matters. No idea why, though..

egeland
  • 1,244
  • 1
  • 12
  • 19