In AngularJS, is it possible to inherit the scope of the parent controller from the enabled partial instead of passing data through the injected service?
Example:
Let's say the ParentCtrl scope looks like this: { testData: 'testing stuff' }
<div ng-controller="ParentCtrl"> Here we're defined: {{testData}} <div ng-include="'partial.html'"></div> </div>
And inside partial.html :
<em>Inherited: {{testData}}</em>
Thus, a partial element does not even need its own controller. If this is not possible, and you can only transfer injected data between controllers through the service, why did Angular do this?
javascript angularjs angularjs-scope
saricden
source share