UNPKG

ng-ytl-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

23 lines (19 loc) 612 B
import { Component } from '@angular/core'; import { NzMessageService } from '../../../index.showcase'; @Component({ selector : 'nz-demo-message-loading', template : ` <button nz-button [nzType]="'default'" (click)="createBasicMessage()">显示加载中</button> `, styles : [] }) export class NzDemoMessageLoadingComponent { constructor(private _message: NzMessageService) { } createBasicMessage(): void { const id = this._message.loading('正在执行中', {nzDuration: 0}).messageId; setTimeout(_ => { this._message.remove(id); }, 2500); } }