I'm using the controller as syntax, which works great for sharing between controller directives, but I can't figure out how to do this with ng-repeat. It seems to insist that the data is a scope variable (not this) which is not what I want.
<div ng-controller="StudyCtrl as study">
<input type="text" ng-model="data[0].name">
<ul>
<li ng-repeat="item in data">{{item.name}}</li> </ul>
<div ng-controller="OtherCtrl as other">
<input type="text" ng-model="study.name"> <!-- I can even change on both ctrls -->
<input type="text" ng-model="data[0].name"> <!-- this will update in both ctr inputs, but not on the ng-repeat! -->
</div>
// in my controller I would have
// using $scope.data = {} works, but then I don't have full access to it
The point of this is, I have an ng-repeat with one controller and scope and a form that allows the user to edit this data with another controller and scope- When there is a change, it needs to be reflected in both spots and I'm trying to avoid root scope or passing objects back and forth in services.
Thanks for the help!