Struggling with a persistent issue in my angularJS $scope. I've been working on updating an array within a controller function, and even though the values are changing based on console logs, the view isn't reflecting those changes. Here's what I have:
//array initialization
$scope.fieldSuggestions = []
//modification function
$scope.changeCurrentInput = function(fieldName, eye) {
for(var field in $scope.test){
console.log($scope.test[field].name)
if($scope.test[field].name === fieldName){
console.log($scope.test[field].values)
console.log("before update")
console.log($scope.fieldSuggestions)
$scope.fieldSuggestions = $scope.test[field].values;
console.log("after update")
console.log($scope.fieldSuggestions)
}
}
};
//view
<div ng-repeat="choice in fieldSuggestions">
<button class="button button-positive">{{choice}}</button>
</div>
ADDITIONAL INFORMATION...
A potential clue to this problem is that I'm dealing with a parent view along with multiple child views. All of these routes share the same controller. Specifically, the property controller in routes.js remains constant across all routes. The button triggering the modification function is located in the child views, while the ng-repeat that fails to update is in the parent view.