javascript - angularjs $watch not work in my item -



javascript - angularjs $watch not work in my item -

<input ng-model="myinput" type="email" placeholder="recipient" />

controller :

$scope.myinput = 3; $scope.$watch('myinput', function() { console.log(1); });

when input in console.log(1),not work!

$watch execute if myinput has valid email value .if don't have valid email myinput seems undefined.that reason $watch not execute.so set valid email in field , check executing or not.

javascript angularjs watch

Comments