-
Notifications
You must be signed in to change notification settings - Fork 27.5k
TypeError: parsedNgModelAssign is not a function #11913
Comments
OK, this may not be an issue at all. Adding { updateOn: 'change' } to the ng-model-options seems to fix it. |
Interesting. Can you post a plnkr with a reproduction? |
Looking at your Plunk, I think that I don't think that { updateOn: 'change' } is a valid setting. Is 'change' an event that can occur on a label? By adding this, the setter is not being called at all (only the getter), which is why there is no error. If you change to { updateOn: 'default' } which is valid, then the setter is called and the error returns. Unless you disagree, I think that Angular is working correctly and this issue can be closed. |
@ryanhart2 is right, the model must not be a fn expression if it is a getterSetter. Likewise, ngModel on a label should not really work; it doesn't have an input method, it does not fire events, and it's not possible to set its value. |
Yep, thanks @ryanhart2 and @Narretz, my mistake, sorry! :) Please close. |
@AndrewIsh @Narretz @ryanhart2 I received a similar error when I used function expressions. And in the examples on https://docs.angularjs.org/api/ng/directive/ngModelOptions. it clearly uses function expressions.
Name:
`
user.name = is it because it is used with ng-bind and not ng-model? Must we use function expression with ng-bind ? If function expression must not be used then I believe example in doc should indicate so. Can I raise a issue here for suggestions on docs? |
@jforjava1981, it's not clear how you are using it and if it is supported. Only If you think the docs can be improved, a pull request is most welcome 😃 (but opening an issue about it helps as well). |
@gkalpak Got it !! I missed that ng-model in the example is indeed using it correctly without function expressions. . So as ng-bind doesn't even consider ng-model-options while using ng-bind we have to refer a property as it should (function expression if its a function or normal property reference otherwise) Hope now I understand it correctly. |
Hello Guys, I am upgrading my angular project from 1.5.8 to 1.6.4 and after updating the project, when I run the application I am getting following exceptions on the console. Not sure why it is happening. angular.js:14525 TypeError: modelCtrl.$$initGetterSetters is not a function TypeError: ctrl.$isEmpty is not a function |
@nehagupta13688, the migration guide is a good place to start. |
Plunker
When trying to make use of ng-model-options and getterSetter: true, I am receiving the following error when trying to set:
I am unable to find a declaration for parsedNgModelAssign().
In my template:
In my controller:
Toggling the btn-checkbox triggers the error.
The text was updated successfully, but these errors were encountered: