Hello! thank you for your answer it helped a lot! The usage of a controller for each directive is a nice and clean solution for my problem!
cheers chris Am Mittwoch, 10. Februar 2016 08:14:51 UTC+1 schrieb Sander Elias: > > Hi Christoph, > > In your sample you declare an `var svg` inside your directive's code > directly. As directives only get's instantiated once, there is only 1 for > your application. A better approach is to use a controller, where you can > store the 'locals' for your directive. > I adapted your sample a bit <http://jsfiddle.net/dgc5d2gb/>to illustrate > this. There is more work needed, but this should be enough to set you on > your track. You can inject your $element and $scope directly into your > directive. (even better, you don't need a $scope at all, but this outside > the reach of your question!) > > Does this help you a bit? > > 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 https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
