0
我使用角度ui作爲模式,當我按下它時,它進入我指定的數組,但它不會立即更新它應該,我仍然必須刷新頁面AngularJS不會立即更新當我推入Modal
<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
})
你的意思是裏面插入我的 「addRule」 功能的其他功能? – BlackenedRed
是的。它將更新Scope中的視圖。 –
它會引發錯誤「錯誤:[$ rootScope:inprog] $ apply already progress in progress」 – BlackenedRed