Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.logs 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.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.