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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -