I have a set of angular directives, each has its own state and feeds from different states and events whether from other directives or other system wide events (e.g. resize, scroll).
I want to be able to detach these directives and not have a direct dependency between them.
I do not want to use angular's event system for two reasons - 1. performance considerations, mainly when needing to broadcast the event down from the rootscope. 2. it creates a dependency between the directives, as one directive will have to know the events of other directives and register on them. Also requiring another directive's controller is out of the question due to the dependency it creates.
Basically i want these directives to be able to function correctly both when other dependent directives are in play, or when they are not..
Currently I'm thinking about having a directives manager service that will use APIs that will be defined on each directive and stitch the system together.
No idea if this is a correct approach or how exactly it can be done... Any thoughts?