我在使用angular ui modal时遇到了麻烦。
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
size: size,
scope: $scope,
resolve: {
items: function () {
return $scope.items;
}
}
});
示例如下:plnkr。复选框的行为是不同的。我想这是范围的问题。如何让它起作用?
我们找到了解决方案…
由于作用域嵌套,作用域在模态内部被破坏。
试着在原型作用域中使用它。
,
scope.check美元。Auto和$scope.check.notif当你在控制器中为这些变量设置值时,它们在模态和模态外都得到反映。
欢呼