Tag: angularjs model

AngularJS – 如何改变自定义指令ngModel的值?

让我们看看我的指示: angular.module('main').directive('datepicker', [ function() { return { require: '?ngModel', link: function(scope, element, attributes, ngModel) { ngModel.$modelValue = 'abc'; // this does not work // how do I change the value of the model? 那么,如何改变ng模型的价值呢?