[英]DOM is not updated by pushing object into the Array,database is updated after pushing the data
I have verified data in the database, it is getting updated, but DOM is not getting updated. 我已经验证了数据库中的数据,该数据正在更新,但是DOM没有更新。
<ul>
<li ng-repeat="aReview in reviewList">
....
....
</li>
</ul>
<script>
if(globalMethods.stringValidation($scope.reviewList))
{
$scope.reviewList.push(optData);
}
else
{
$scope.reviewList=[];
$scope.reviewList.push(optData);
}
</script>
If you are using a third party libraries to manipulate your data, angular may not be aware of changes to data. 如果您使用第三方库来处理您的数据,Angular可能不会意识到数据的变化。 To get angular to recheck things, you have to mannually invoke $scope.$apply() after manipulating your data
为了使角度能够重新检查事物,您必须在处理数据后手动调用$ scope。$ apply()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.