//angularjs 在指令中通过dom修改input 的Value值同时更新model obj.directive('test',['$parse',function ($parse) { var dateFilter = $filter('date'); return { require: 'ngModel',link: function (scope,element,attrs,ctrl) { element[0].value ="Your data"; //更新模型 $parse(attrs['ngModel']).assign(scope,element[0].value); } }; }]);参考: https://segmentfault.com/q/1010000000347476 原文链接:https://www.f2er.com/angularjs/148615.html