I have an element directive that has an attribute directive on it. At first I created the attribute directive separately, and it worked.
However, when I try to embed the attribute within the element directive, a filter on an ng-repeat
within the element directive gives me issues saying that i'm passing empty data. I'm not sure why this is happening.
This works:
app.directive('exclude', function () {
return function (scope, element, attrs) {
console.log(attrs.exclude);
};
});
This does not:
app.directive('extendedTable', function () {
return {
restrict: 'E',
templateUrl: 'owner-table.html',
scope: {
'exclude':'@'
},
link: function(scope,element,attrs){
console.log(scope.exclude);
}
};
});
The scope.exclude
console.log
s correctly, but it gives me an error on the data being passed to a filter when the directive is run. Why is this happening? Am I doing something incorrectly?
When I comment out the scope/link part of the element directive, the error goes away.