[英]How to call $modal.open in Ui-Bootstrap 0.10.0 from controller in angularjs
如何在角度js中从控制器调用$modal.open
。 以前在ui-bootstrap中有0.1.0对话框。 现在在当前版本中,调用对话框的权限是什么。
在0.1.0中它只是$ dialog.dialog(); 然后调用Dialog(); 在Lib -
return {
// Creates a new `Dialog` with the specified options.
dialog: function(opts){
return new Dialog(opts);
},
// creates a new `Dialog` tied to the default message box template and controller.
//
// Arguments `title` and `message` are rendered in the modal header and body sections respectively.
// The `buttons` array holds an object with the following members for each button to include in the
// modal footer section:
// * `result`: the result to pass to the `close` method of the dialog when the button is clicked
// * `label`: the label of the button
// * `cssClass`: additional css class(es) to apply to the button for styling
messageBox: function(title, message, buttons){
return new Dialog({templateUrl: 'template/dialog/message.html',
controller: 'MessageBoxController', resolve: {model: {
title: title,
message: message,
buttons: buttons
}}});
}
任何人都知道如何在0.10.0中调用$ modal.open吗?
function open() {
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
resolve: {
items: function () {
return $scope.items;
}
}
});
});
var ModalInstanceCtrl = function ($scope, $modalInstance, items) {
$scope.items = items;
});
open();
更换
function open() {
至
$scope.open = function() {
并打电话
$scope.open()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.