嗨我试图更好地了解angularJs手表功能 为了做到这一点,我做了以下bin enter link description here 其中包含一块手表。 手表第一次正确执行,我可以看到新旧价值。 我第二次为这两个数字和字符串输入框我DONOT看到新旧值进入登录
$scope.$watch(function(theScope){
console.log(typeof theScope.price ==='number'); //logs true
if(typeof theScope.price ==='number'){
return theScope;
}else{
return false
}
},function(oldValue,newValue){
console.log('old:'+oldValue);
console.log('new:'+newValue);
});