我需要角度指令的链接函数中的$ filter,但是没有办法将$ filter作为参数传递给链接函数。
app.directive('myDirective', function($compile) {
return {
restrict: 'A',
scope: {
ngModel: '=',
},
require: 'ngModel',
link: function($scope, elem, attr, ctrl) {
}
};
});
http://plnkr.co/edit/XpnY5dq7rnl2sWXlsN4t?p=preview
如何访问链接函数内部的$过滤器?
u能交一个plnkr请。 – Vivek
不太确定答案的复杂程度,但下面是一个更新程序:http://plnkr.co/edit/3RhXJN0sIDp4Ps6c5kDS?p=preview –