Answer the question
In order to leave comments, you need to log in
Internal module, creates 2 scopes?
Please help the great Gurus, I have already spent a lot of time on this.
An easy example is jsfiddle.net/zggwx567/10
For some reason, the directive from the module is compiled first - "my-dir" ,
then - "my-directive" , and then because "my-directive" is compiled again - "my -dir"
2 clicks in a row occur - how to fix this?
Answer the question
In order to leave comments, you need to log in
I don't know why you didn't use the ngRepeat + ngTransclude combination to solve the original problem, but oh well.
And the click happens twice because first your directive was processed by Angular and then you compiled this thing again. That is, you did not just compile, but did it with the same piece of DOM, so that everything was duplicated. One of the options is to make a clone of the elements and then compile. Well, or remove manual compile from myDirective, it is not needed there. And if you need it, it's better to replace it with ngTransclude.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question