本文整理汇总了TypeScript中ng-zorro-antd.NzModalService类的典型用法代码示例。如果您正苦于以下问题:TypeScript NzModalService类的具体用法?TypeScript NzModalService怎么用?TypeScript NzModalService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NzModalService类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(modalSrv: NzModalService) {
modalSrv.closeAll();
}
开发者ID:jijiechen,项目名称:openaspnetorg,代码行数:3,代码来源:500.component.ts
示例2: constructor
constructor(private router: Router, modalSrv: NzModalService) {
modalSrv.closeAll();
}
开发者ID:wexz,项目名称:delon,代码行数:3,代码来源:login.component.ts
示例3: showConfirm
showConfirm(): void {
this.modalService.confirm({
nzTitle : '<i>Do you Want to delete these items?</i>',
nzContent: '<b>Some descriptions</b>',
nzOnOk : () => console.log('OK')
});
}
开发者ID:SrgGs,项目名称:ng-zorro-antd,代码行数:7,代码来源:confirm.ts
示例4: info
info(): void {
this.modalService.info({
nzTitle: 'This is a notification message',
nzContent: '<p>some messages...some messages...</p><p>some messages...some messages...</p>',
nzOnOk: () => console.log('Info OK')
});
}
开发者ID:fengyongqing,项目名称:ng-zorro-antd,代码行数:7,代码来源:info.ts
示例5: open
/**
* 打开对话框,默认会过滤一些事件的回调,因此更容易处理回调:
* this.modalHelper.open(FormEditComponent, { i }).subscribe(res => this.load());
*
* 对于组件的成功&关闭的处理说明:
* 成功:
* this.subject.destroy('onOk');
* 若需要回调用参数则:
* this.subject.next(data);
* this.subject.destroy();
*
* 关闭:
* this.subject.destroy();
*
* @param {*} comp 组件
* @param {*} [params] 组件参数
* @param {('sm' | 'lg' | '' | number)} [size='lg'] 大小;例如:lg、600,默认:lg
* @param {*} [options] 对话框ConfigInterface参数
*/
open(comp: any, params?: any, size: 'sm' | 'lg' | '' | number = 'lg', options?: any): Observable<any> {
let cls = '', width = '';
if (size) {
if (typeof size === 'number') {
width = `${size}px`;
} else {
cls = `modal-${size}`;
}
}
return this.modalSrv
.open(Object.assign({
wrapClassName: cls,
content: comp,
width: width ? width : undefined,
footer: false,
componentParams: params
}, options || {}))
.pipe(filter((res: any) => {
let findIdx = -1;
if (typeof res === 'string') {
const resStr = res as string;
findIdx = ['onShow', 'onShown', 'onHide', 'onHidden', 'onCancel', 'onDestroy'].findIndex(w => resStr.startsWith(w));
}
return findIdx === -1;
}));
}
开发者ID:ezhuo,项目名称:angular-admin-ng-zorro,代码行数:45,代码来源:modal.service.ts
示例6: success
success(): void {
const modal = this.modalService.success({
nzTitle: 'This is a notification message',
nzContent: 'This modal will be destroyed after 1 second'
});
window.setTimeout(() => modal.destroy(), 1000);
}
开发者ID:SrgGs,项目名称:ng-zorro-antd,代码行数:8,代码来源:manual.ts
示例7: showConfirm
showConfirm(): void {
this.confirmModal = this.modal.confirm({
nzTitle: 'Do you Want to delete these items?',
nzContent: 'When clicked the OK button, this dialog will be closed after 1 second',
nzOnOk: () => new Promise((resolve, reject) => {
setTimeout(Math.random() > 0.5 ? resolve : reject, 1000);
}).catch(() => console.log('Oops errors!'))
});
}
开发者ID:SrgGs,项目名称:ng-zorro-antd,代码行数:9,代码来源:confirm-promise.ts
示例8: catchError
catchError((err: HttpResponse<any>, caught: Observable<any>) => { // 返回异常
if (err.status === 401) {
this.confirmSrv.warning({
nzTitle: '提示',
nzContent: '登录超时,请重新登录!',
nzOnOk: () => { }
});
}
return Observable.create(observer => observer.next(event));
})
开发者ID:zmlovelin,项目名称:tools,代码行数:10,代码来源:noop-interceptor.ts
示例9:
@HostListener('click')
_click() {
this.confirmServ.confirm({
title: 'Make sure clear all local storage?',
onOk: () => {
localStorage.clear();
this.messageServ.success('Clear Finished!');
}
});
}
开发者ID:staneee,项目名称:ABPTemplateUI-ng-alain,代码行数:10,代码来源:storage.component.ts
示例10: showDeleteConfirm
showDeleteConfirm(): void {
this.modalService.confirm({
nzTitle : 'Are you sure delete this task?',
nzContent : '<b style="color: red;">Some descriptions</b>',
nzOkText : 'Yes',
nzOkType : 'danger',
nzOnOk : () => console.log('OK'),
nzCancelText: 'No',
nzOnCancel : () => console.log('Cancel')
});
}
开发者ID:SrgGs,项目名称:ng-zorro-antd,代码行数:11,代码来源:confirm.ts
示例11: view
public view(profile: Contact) {
const modal = this.modalService.create({
nzTitle: null,
nzFooter: null,
nzClassName: 'card-modal',
nzMaskStyle: {backgroundColor: 'transparent'},
nzContent: ProfileComponent,
nzComponentParams: {
profile: profile
}
});
}
开发者ID:yangjinguang,项目名称:liyu,代码行数:12,代码来源:profile.service.ts
示例12: Observable
return new Observable((observer) => {
this.confirmSrv.confirm({
title: '确认要离开吗?',
content: '你已经填写了部分表单离开会放弃已经填写的内容。',
okText: '离开',
cancelText: '取消',
onOk: () => {
observer.next(true);
observer.complete();
},
onCancel: () => {
observer.next(false);
observer.complete();
}
});
});
开发者ID:duxie,项目名称:ng-alain,代码行数:16,代码来源:can-leave.provide.ts
示例13: successHandle
this.tenantApi.listCurrent().subscribe(tenants => {
console.log(tenants.data);
if (tenants.data.length <= 0) {
this.message.error('未绑定租户');
return;
}
if (tenants.data.length <= 1) {
successHandle(tenants.data[0]);
} else {
const modal = this.modal.create({
nzTitle: '选择公司',
nzWidth: '521px',
nzContent: LoginTenantSelectComponent,
nzComponentParams: {
tenants: tenants.data
},
nzFooter: null
});
modal.afterClose.subscribe((t: Tenant) => {
successHandle(t);
});
}
});
开发者ID:yangjinguang,项目名称:liyu,代码行数:23,代码来源:login.component.ts
示例14: warning
warning(): void {
this.modalService.warning({
nzTitle: 'This is an warning message',
nzContent: 'some messages...some messages...'
});
}
开发者ID:fengyongqing,项目名称:ng-zorro-antd,代码行数:6,代码来源:info.ts
示例15: error
error(): void {
this.modalService.error({
nzTitle: 'This is an error message',
nzContent: 'some messages...some messages...'
});
}
开发者ID:fengyongqing,项目名称:ng-zorro-antd,代码行数:6,代码来源:info.ts
示例16: success
success(): void {
this.modalService.success({
nzTitle: 'This is a success message',
nzContent: 'some messages...some messages...'
});
}
开发者ID:fengyongqing,项目名称:ng-zorro-antd,代码行数:6,代码来源:info.ts
示例17: info
public info() {
this.confirmServ.info({
title: '请先登录',
});
}
开发者ID:jiedengye111,项目名称:angular-base,代码行数:5,代码来源:const.ts
示例18:
.subscribe(() => {
this.titleSrv.setTitle();
this.modalSrv.closeAll();
});
开发者ID:jijiechen,项目名称:openaspnetorg,代码行数:4,代码来源:app.component.ts
注:本文中的ng-zorro-antd.NzModalService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论