E
E
Egor2014-09-28 14:26:21
Angular
Egor, 2014-09-28 14:26:21

Angular: How to call my class-bound directive after ng-class is executed?

Greetings.
There is a directive

app.directive('myDirective',function(){
return {
    restrict:'C',
    link:function(){
       DoSomething()'
     }
}
});

in the template the class is assigned via ng-class
<div ng-class="{'my-direcitve': a > 0}">Lorem ipsum...</div>

But the directive doesn't work. I read that ng-class is executed at the very end, so my directive doesn't work.
How can I solve the problem so that my directive will work using ng-class?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-09-28
Protko @Fesor

Alas, in no way (in an adequate way anyway). You need to come up with another way to activate the directive.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question