Answer the question
In order to leave comments, you need to log in
How to force the frontend to fetch data after completing a query to the database on the server?
There is a code like this in angularjs
CPElement.update({id: $scope.elements[elemId].id}, $scope.elements[elemId]).then($scope.calculate());
Answer the question
In order to leave comments, you need to log in
As a result, y passed the update function parameter to calback and it worked.
CPElement.update({id: id}, data,function(){
$scope.calculate()
})
1. yii has nothing to do with it
2. Do you understand that then and when are fundamentally different words?
https://docs.angularjs.org/api/ng/service/$q#when
The problem is that the recalculation response comes before the actual data in the update request is applied to the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question