in AngularJS I can define a controller for a section on a page. I can have one page with multiple controllers.
<div ng-controller="ThisSectionController"> .... </div> <div ng-controller="ThatSectionController"> .... </div>
I can reuse the controller when sending another configuration using ng-init
<div ng-controller="MyController" ng-init="i = 1"> {{ i }} </div> <div ng-controller="MyController" ng-init="i =2" > {{ i }} </div>
This will output 1 and 2 as you expect.
My question is: how can I reuse the controller and configure it to use another service?
source share