Answer the question
In order to leave comments, you need to log in
Is it possible to get all defined directives in the current scope?
Good afternoon.
I've been struggling with the problem for a whole day
Code:
<book>
<lief ng-repeat='link in [1,2,3,4]>
<img ng-src='{{link}}.png' >
</lief>
</book>
app.directive('book', function () {
return {
template: '<div class="ng-book" ng-transclude>' +
'</div>',
replace: true,
transclude: true,
restrict: 'E',
controller: function ($scope) {
},
link: function(scope, elem, attr, controller) {
}
};
});
app.directive('lief', function () {
return {
template: '<div class="ng-lief" ng-transclude></div>',
//templateUrl: 'directive.html',
replace: true,
transclude: true,
restrict: 'E',
controller: function ($scope) {
},
link: function(scope, elem, attr, controller) {
}
};
});
app.directive('book', function () {
return {
template: '<div class="ng-book" ng-transclude>' +
'</div>',
replace: true,
transclude: true,
restrict: 'E',
controller: function ($scope) {
},
link: function(scope, elem, attr, controller) {
$timeout(function () {
elem.find("img");
}, 1000)
}
};
});
Answer the question
In order to leave comments, you need to log in
I didn't really understand the question, but I think you need to specify in
the lief directive: you can call a function from the scope of the book directive by adding another picture to it.
Damn, it's so easy for
anyone who is interested, I just used $document.ready (func)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question