nghellostyle icon indicating copy to clipboard operation
nghellostyle copied to clipboard

directives share same object

Open tschiela opened this issue 9 years ago • 1 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.

tschiela avatar Oct 15 '15 08:10 tschiela

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.

jmcmichael avatar Oct 28 '15 17:10 jmcmichael