Мне нужно проверить методы с контроллера в директиве.Контроллер контроля доступа в угловой директиве
APP.angular.directive('miniCrud', function() {
return {
restrict: 'E',
require:"ngModel",
scope: {
miniCrudHeader: '@',
miniCrudConfig: '=',
modelValues : "=ngModel"
},
templateUrl: 'templates/mini-crud.html',
controller: ['$scope', 'lodash', 'filterFilter',
function($scope, _, filterFilter){
$scope.vm = {
getValue: function(item, index) {
var prop = $scope.miniCrudConfig.fields[index].name;
return item[prop];
}
// some other methods
}
}
}]
};
});
Как я могу использовать $ scope.vm.getValue()?