我正在使用角度ui作为模态,当我按下时,它进入我指定的数组但它不会像它应该的那样立即更新,我仍然需要刷新页面
<button class="btn btn-regular mustard-lighten-1 white-text" ng-click="showModal()"><span class="material-icons">add</span></button>
$scope.showModal = () => {
let modalInstance = $uibModal.open({
animated: true,
templateUrl: 'pages/modals/add-modal.html',
controller: 'homeController'
})
} // show modal on the overview page
$scope.addRule = () => {
$scope.rules.push({
// properties inside here
})
答案 0 :(得分:0)
更新1:试试这个。
$timeout(function () {
$scope.rules.push({
// properties inside here
});
},1100);
试试这个,这对我有用:
$rootScope.$apply(function () {
$scope.rules.push({
// properties inside here
});
});