angualr|angularjs----mark

【angualr|angularjs----mark】 watch进行监控, parse 手动解析

http://jsbin.com/rasafitame/edit?html,js,output
JS Bin - 锐客网 {{1}}
解析值{{parsedValue}}

var app = angular.module('myApp',[]); app.controller('myController',['$scope','$parse',function($scope,$parse){ $scope.$watch('expr',function(oldVal,newVal,scope){ if(oldVal !== newVal){ var parseFun = $parse('expr'); $scope.parsedValue = https://www.it610.com/article/parseFun(scope); } }); }]);

    推荐阅读