Saturday, March 19, 2016

Error: [ngModel:nonassign]

While working with angular js, i encountered an issue of the following type:

Error: [ngModel:nonassign]

I researched a bit and found that the issue occurs due to the fact that I was trying to call a controller function using the ng-model, which is not correct.

Just call the function using the following syntax:

  <span>{{ calculateSum() }}</span> 


  <span  ng-bind="calculateSum()"></span>

The first one uses the Expressions and second one uses the ng-bind directive.

No comments:

Post a Comment