Angular - Directive reflecting ngModel array
问题 This is piggy-backing a little off an earlier question. I have been trying to work with directives and data from a model/array My model looks something like this: $scope.testModel = { inputA:[1,2,3] }; Then I would have inputs for each. My directive is checking, on keyup, if the input is greater than a given number (10). If it is, then it sets it as 10. link: function(scope, element) { scope.$watch('ngModel',function(val){ element.val(scope.ngModel); }); element.bind("keyup", function(event)