watch changes on JSON object properties
问题 I'm trying to implement a directive for typing money values. var myApp = angular.module('myApp', []); var ctrl = function($scope) { $scope.amount = '0.00'; $scope.values = { amount: 0.00 }; }; myApp.directive('currency', function($filter) { return { restrict: "A", require: "ngModel", scope: { separator: "=", fractionSize: "=", ngModel: "=" }, link: function(scope, element, attrs) { if (typeof attrs.separator === 'undefined' || attrs.separator === 'point') { scope.separator = "."; } else {