Angular 中修改bootstrap的模态框(modal)大小
2017-11-20 10:46
363 查看
Angular 中修改bootstrap的模态框(modal)大小
自己瞎搞改width的后果。。。
看官网文档:https://ng-bootstrap.github.io/#/components/modal/examples
https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/modal/modal.ts
最终解决:
showWarnningModal() {
this.modalService.open(this.warnningModal, { size: 'lg' }).result.then((result) => {
if (result === 'OK') {
// this.loadTopQueueDeliveryOrder();
}
}, (reason) => {
// this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
import { Injector,
ComponentFactoryResolver }
from '@angular/core';
import { NgbModalStack }
from './modal-stack';
import { NgbModalRef }
from './modal-ref';
/**
* Represent options available when opening new modal windows.
*/
export interface
NgbModalOptions {
/**
* Whether a backdrop element should be created for a given modal (true by default).
* Alternatively, specify 'static' for a backdrop which doesn't close the modal on click.
*/
backdrop?: boolean
| 'static';
/**
* An element to which to attach newly opened modal windows.
*/
container?: string;
/**
* Whether to close the modal when escape key is pressed (true by default).
*/
keyboard?: boolean;
/**
* Size of a new modal window.
*/
size?: 'sm'
| 'lg';
/**
* Custom class to append to the modal window
*/
windowClass?:
string;
}
/**
* A service to open modal windows. Creating a modal is straightforward: create a template and pass it as an argument to
* the "open" method!
*/
export declare
class
NgbModal {
private
_moduleCFR;
private
_injector;
private
_modalStack;
constructor(_moduleCFR:
ComponentFactoryResolver, _injector:
Injector, _modalStack:
NgbModalStack);
/**
* Opens a new modal window with the specified content and using supplied options. Content can be provided
* as a TemplateRef or a component type. If you pass a component type as content than instances of those
* components can be injected with an instance of the NgbActiveModal class. You can use methods on the
* NgbActiveModal class to close / dismiss modals from "inside" of a component.
*/
open(content:
any, options?:
NgbModalOptions):
NgbModalRef;
}
自己瞎搞改width的后果。。。
看官网文档:https://ng-bootstrap.github.io/#/components/modal/examples
https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/modal/modal.ts
最终解决:
showWarnningModal() {
this.modalService.open(this.warnningModal, { size: 'lg' }).result.then((result) => {
if (result === 'OK') {
// this.loadTopQueueDeliveryOrder();
}
}, (reason) => {
// this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
import { Injector,
ComponentFactoryResolver }
from '@angular/core';
import { NgbModalStack }
from './modal-stack';
import { NgbModalRef }
from './modal-ref';
/**
* Represent options available when opening new modal windows.
*/
export interface
NgbModalOptions {
/**
* Whether a backdrop element should be created for a given modal (true by default).
* Alternatively, specify 'static' for a backdrop which doesn't close the modal on click.
*/
backdrop?: boolean
| 'static';
/**
* An element to which to attach newly opened modal windows.
*/
container?: string;
/**
* Whether to close the modal when escape key is pressed (true by default).
*/
keyboard?: boolean;
/**
* Size of a new modal window.
*/
size?: 'sm'
| 'lg';
/**
* Custom class to append to the modal window
*/
windowClass?:
string;
}
/**
* A service to open modal windows. Creating a modal is straightforward: create a template and pass it as an argument to
* the "open" method!
*/
export declare
class
NgbModal {
private
_moduleCFR;
private
_injector;
private
_modalStack;
constructor(_moduleCFR:
ComponentFactoryResolver, _injector:
Injector, _modalStack:
NgbModalStack);
/**
* Opens a new modal window with the specified content and using supplied options. Content can be provided
* as a TemplateRef or a component type. If you pass a component type as content than instances of those
* components can be injected with an instance of the NgbActiveModal class. You can use methods on the
* NgbActiveModal class to close / dismiss modals from "inside" of a component.
*/
open(content:
any, options?:
NgbModalOptions):
NgbModalRef;
}
相关文章推荐
- Angular之模态弹窗ui-bootstrap-modal及轻量级弹窗ngDialog
- angular2 ngx-bootstrap modal模态框不在最上层
- bootstrap 模态框(modal)实现水平垂直居中显示的方法
- Bootstrap 模态框(Modal)插件
- Bootstrap使用模态框modal实现表单提交弹出框
- Bootstrap 模态框(Modal)插件
- 浅析BootStrap中Modal(模态框)使用心得
- bootstrap插件--模态框(modal)
- angular modalInstance模态框
- bootstrap中模态框的大小设置;
- Bootstrap modal 模态框垂直居中
- 浅谈angular-ui-bootstrap-modal这个骚东西
- bootstrap中模态框的大小设置
- 关于BootStrap中Modal(模态框)使用心得
- Bootstrap 实例 - 模态框(Modal)插件
- [置顶] 关于BootStrap中Modal(模态框)使用心得
- Bootstrap模态框(Modal)实现过渡效果
- bootstrap 弹出包含iframe模态窗口的修改
- 扩展bootstrap的modal模态框-动态添加modal框-弹出多个modal框
- Bootstrap 模态框(Modal)插件数据传值