I'm trying to update the sections of stores in my user. To do this I think I need the indexOf the array. I can get it in the html, but am having a hard time doing it in the angular controller.
//controller
// How do I get indexOf $scope.global.user.store[?] here instead of in html?
$scope.$watch('radio.model', function() {
$scope.filteredArray = filterFilter($scope.global.user.store, {});
}, true);
I can select a radio button and it'll tell me the indexOf the store in the Array
<!-- html -->
<div ng-repeat="entry in filteredArray | filter: {name:radio.model.name}">
{{filteredArray.indexOf(entry)}}
</div>
I need to be able to say, for example, $scope.global.user.store[1].section = $scope.newSectionInput so I can $update. My friend told me there's another way to update an object inside an array using something called the dot rule, if that helps answer this question. How do I get the indexOf inside the js controller? Been working on this for 24+ hours, tried searching all over, can't find the answer to this question.
Update:
<li ng-repeat="store in global.user.store">
<label ng-model="radio.model" btn-radio="store">
{{store.name}}
</label>
</li>
So the idea is it's a section in the store. So I look up the store object which has a name property and section property. And I want to update the store object with different sections.