Typically, in all AngularJS examples / source code, area modifications are performed in controllers. In my directive, I need to get some information from another directive (or its scope) and put it in scope (as seen in the template directive). Since this information is common to all instances of this directive, using region binding is not suitable for me.
So, the only solution I found is to change the scope of the instance in the binding function:
link: function(scope, element, attr, parentCtrl) { scope.data = parentCtrl.someData; }
This solution works. Plnkr example
Question: Is it good to change the scope of the binding function in accordance with AngularJS philosophy / style, or is there another solution?
source share