I want to update my Angular model based on text input which its value defined by Jquery script. How do I do that?
My Jquery
$("fire").click(function (e) {
$("#modelChanger").val(1));
});
My DOM :
<input ng-model="data" type="text" id="modelChanger" ng-change="changeIt()"/>
My Angular controller:
$scope.data= 0; // I hope this one change to 1, but it wont
$scope.changeIt = function(){
$scope.data++;
}
I know ng-change always work for user directly change the value of any element. Is there other angular directive to solve this one? Any advice guys?