Bac*_*tnz 10 jquery angularjs angular-ui
我有几个模态,2个完美地工作,1在关闭时获得此异常.(它确实设法关闭模态,但angular注销了这个例外).
我看得更近了,在$modalInstance方法中定义close,但openedWindows.get($modalInstance)返回undefined.
我怎样才能解决这个问题?
Nar*_*ana 16
这是v0.10.0中$ modal中的错误.请参阅此github问题,并将在下一版本中修复.
@IvanZh在这里提供了类似问题的答案 - 在URL更改时关闭角度模态 - 控制台中的错误
在你的控制器中,一旦你执行$ modal.open,添加一个finally块,你明确地将modalInstance设置为null.上面的问题中提供了关于URL更改的解雇模式的plunkr.你的应该非常相似.
$scope.modalInstance = $modal.open({
templateUrl: 'add.html',
controller: 'AddCtrl'
});
$scope.modalInstance.result.then(function() {
console.log('Success');
}, function() {
console.log('Cancelled');
})['finally'](function(){
$scope.modalInstance = undefined // <--- This fixes
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
35490 次 |
| 最近记录: |