zemirco / nghellostyle

AngularJS seed for Google Closure Compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

directives share same object

tschiela opened this issue · comments

All works fine, until we use a directive multiple times on a site. Directive.factory will only be called once. So all directives on sites share the same Directive object.

I believe Angular factories are singletons, so will be called only once regardless of the context in which Angular is running. It's the link and controller functions that will be called multiple times and I don't see anything in the code that would prevent this. But I've only just skimmed it so I might have missed something.