You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Onchange event for the elements having isolate scope is getting triggered before the model update.
Example:
<!doctype html><htmlng-app="App"><head><linkrel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /><scripttype="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script><scriptsrc="http://code.angularjs.org/1.0.6/angular.js"></script><scriptsrc="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script><scripttype="text/javascript">"use strict"varApp=angular.module('App',[]);App.controller('Ctrl',function($scope,$timeout){$scope.change1=function(){console.warn("inside change",$scope.y);}$scope.change2=function(){console.warn("inside change",$scope.x);}});App.directive("wminput",function(){return{restrict: "E",replace: true,scope: {"onChange":"&","value": "="},template: '<input type="text" data-ng-model="value" data-ng-change="onChange();">'}});</script></head><body><divdata-ng-controller="Ctrl">
"Onchange will be triggered after the model update"
<inputdata-ng-change="change1()" data-ng-model="y"><br><br>
"Onchange will be triggered before the model update"
<wminputon-change="change2()" value="x"></wminput></div></body></html>