After exploring various questions on Stack Overflow, I have read numerous answers but still cannot seem to solve my issue.
I am currently using Angular Material and struggling with the synchronization between the view and model.
Here is the code for my controller:
$scope.getQuestionByDateRange = function (range) {
QuestionService.getQuestions(1, 'week', 10, function (response) {
$scope.questions = response.data;
})
}
And this is the code for my view:
<ul>
<li ng-repeat="question in questions">{{question.title}}<li>
<ul>
Initially, my view renders the model correctly when updating the $scope.questions
variable in the controller.
However, upon updating the $scope.questions
again, although the model reflects the changes (which I can confirm through console logs), the view does not update accordingly.
Despite researching possible solutions like $scope.$apply
, $scope.$digest
, and $scope.$evalAsync
, I am unable to resolve the issue. What could be causing this problem?