Hi Henrik,

May I make an remark that's not directly related to your problem? 
You are pushing and pulling  state and data to/from the DOM. This is the 
way we worked before we had Angular. In angular, we manage our data in the 
models, witch we keep in controllers/services. Then angular makes sure that 
data is rendered to the DOM. It helps to see this as an one-way street. We 
change data, and the template + directives make sure it's displayed the 
right way. User interaction calls functions in our controllers, which may 
manipulate data, and the cycle repeats. 

It looks like you are making it harder for yourself then is needed by 
trying to get the DOM into that loop. Manipulating the DOM yourself is 
possible but it trips up the cycle. 
>From what i'm reading from your directive, you can replace the directive 
with an ngSwitch statement in your template. 

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to