--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/BqWfGESgSQI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
And in addition to my previous answer, after a first glance over your code, and here is your issue I believe, ngIf defers the execution of your directive to the next digest cycle.
--
Easiest way to defer code to next cycle is using `$timeout(codeIwantInNextCyle,0)` That is something that just is needed sometimes. Usually when setting up stuff in 1 element, that you then need in another element. This is indeed a code smell, and you should hand over the data more explicit, so this crux isn't needed at all. But as I said, sometimes you just have to wait a bit.
I don't have time to figure out what is the exact reason it needs to be deferred in your use-case tough.
--
--
You combine a number of directives that all manipulate/rely on the DOM. So executing them in the wrong order will cause your problem. To find the root cause, you have to go over each and everyone using a debugger. That takes a while. Injecting a $timeout is a crux, but it might save you quite some hours. Oh, and after that debugging, changes are, that $timeout is the right solution after all. (aside from fixing your 3rth party directives.)
--