ここに私のモーダル関数があります:
$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
行うと、うまくいきます! しかし、関数exを呼び出すと。またはexでスコープオブジェクトを使用しようとします。- そうではありません。ご覧のとおり、モーダルでスコープ プロパティに割り当てました。私は何を間違っていますか?また、関数を呼び出してみましたが、まだ機能しません。ng-repeat
ng-repeat
doSomething()
ng-class
ng-class="{'css': doSomething()}"
$scope
$parent
ng-if="$parent.doSomething()"