这是我的模态函数:
$uibModal.open({
templateUrl: config.baseUrl + '/ClientApp/Views/Modals/userEditModal.html' + config.scriptVersion,
size: size,
scope: $scope,
controller: function ($scope, $uibModalInstance) {
$scope.cancel = function () {
$uibModalInstance.close();
};
}
}).result.catch(function (resp) {
if (['cancel', 'backdrop click', 'escape key press'].indexOf(resp) === -1) {
throw resp;
}
})
这$uibModal
是在我有其他$scope
变量和函数的控制器内部。如果我ng-repeat
在模态内部使用父范围对象进行操作ng-repeat
!但是如果我调用一个函数 ex。doSomething()
或尝试在ng-class
ex 中使用范围对象。ng-class="{'css': doSomething()}"
- 它没有。如您所见,我$scope
在模态中分配了范围属性。我究竟做错了什么?我也尝试过调用该函数,$parent
但仍然无法正常工作。ng-if="$parent.doSomething()"