我需要角度指令的鏈接函數中的$ 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 –