I am using beta version 1.3, and now, having switched to 1.3.1, I noticed a problem which, checking all earlier versions, I see that it started with 1.3.0 rc1 .
I have a code like this:
<select ng-model="home.modal.topicId" ng-change="ctrl.modalTopicChanged()" ng-options="item.id as item.name for item in home.modal.option.topics.data" ng-required="true"> <option style="display: none;" value="">Select Topic</option> </select>
Prior to rc1, the ng change was not triggered when the form showed first . Now it starts using home.modal.topicId undefined . This change is for me, but it is not mentioned in the section on changes, and I wonder if this is a mistake that remains to be noticed.
Here is the stack trace created:
TypeError: Cannot read property 'dataMap' of undefined at AdminProblemController.modalTopicChanged (http://127.0.0.1:17315/Content/app/admin/controllers/ProblemController.js:109:114) at $parseFunctionCall (http://127.0.0.1:17315/Scripts/angular.js:11387:18) at Scope.$get.Scope.$eval (http://127.0.0.1:17315/Scripts/angular.js:13276:28) at http://127.0.0.1:17315/Scripts/angular.js:19888:13 at http://127.0.0.1:17315/Scripts/angular.js:19499:9 at forEach (http://127.0.0.1:17315/Scripts/angular.js:331:20) at $$writeModelToScope (http://127.0.0.1:17315/Scripts/angular.js:19497:5) at writeToModelIfNeeded (http://127.0.0.1:17315/Scripts/angular.js:19490:14) at http://127.0.0.1:17315/Scripts/angular.js:19484:9 at validationDone (http://127.0.0.1:17315/Scripts/angular.js:19420:9)
What I see here is a new feature: writeToModelIfNeeded
When I look at the differences in the change log, I cannot find mention of this function that appears when I check all changes and line numbers.
I would like some advice on this. Firstly, you can find the change that caused the addition of writeToModelIfNeeded, and secondly, this is the correct functionality for the selection window. I thought the whole idea was that ng-change would only work when determining the model value.
For reference, here is a region of new code that seems to have been added since 1.3.0 rc.1
** * @ngdoc method * @name ngModel.NgModelController
angularjs
Samantha JT Star
source share