In AngularJS is it possible to inherit the parent controller's scope from within an included partial instead of passing the data through an injected service?
Example case:
Let's say ParentCtrl
's scope looks like: { 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>
So the partial doesn't even need it's own controller for this. If this is impossible though and you can only pass injected data between controllers via a service why has Angular done things this way?