From 29318dbccfc478708499088bf12b0389c92c4f42 Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Sat, 30 Dec 2017 14:59:04 +0800 Subject: [PATCH] docs(showcase): optimization docs (#733) --- .../nz-demo-locale-all.component.ts | 2 +- .../nz-demo-message-loading.component.ts | 22 +++++++++---------- .../nz-demo-spin-nested.component.ts | 7 ++++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/showcase/nz-demo-locale/nz-demo-locale-all.component.ts b/src/showcase/nz-demo-locale/nz-demo-locale-all.component.ts index 3668c07244..54fbc481aa 100644 --- a/src/showcase/nz-demo-locale/nz-demo-locale-all.component.ts +++ b/src/showcase/nz-demo-locale/nz-demo-locale-all.component.ts @@ -82,7 +82,7 @@ export class NzDemoLocaleAllComponent implements OnInit { Click to confirm - +
diff --git a/src/showcase/nz-demo-message/nz-demo-message-loading.component.ts b/src/showcase/nz-demo-message/nz-demo-message-loading.component.ts index 2d2b906053..00bfaed55e 100644 --- a/src/showcase/nz-demo-message/nz-demo-message-loading.component.ts +++ b/src/showcase/nz-demo-message/nz-demo-message-loading.component.ts @@ -1,22 +1,22 @@ -import {Component} from '@angular/core'; -import {NzMessageService} from '../../../index.showcase'; +import { Component } from '@angular/core'; +import { NzMessageService } from '../../../index.showcase'; @Component({ selector : 'nz-demo-message-loading', template : ` -`, + `, styles : [] }) export class NzDemoMessageLoadingComponent { - _id; - createBasicMessage = () => { - this._id = this._message.loading('正在执行中', { nzDuration: 0 }).messageId; - setTimeout(_ => { - this._message.remove(this._id); - }, 2500) - }; + constructor(private _message: NzMessageService) { } -} + createBasicMessage(): void { + const id = this._message.loading('正在执行中', {nzDuration: 0}).messageId; + setTimeout(_ => { + this._message.remove(id); + }, 2500); + } +} diff --git a/src/showcase/nz-demo-spin/nz-demo-spin-nested.component.ts b/src/showcase/nz-demo-spin/nz-demo-spin-nested.component.ts index bd690e73cb..7f7aec2a1b 100644 --- a/src/showcase/nz-demo-spin/nz-demo-spin-nested.component.ts +++ b/src/showcase/nz-demo-spin/nz-demo-spin-nested.component.ts @@ -7,8 +7,11 @@ import { Component } from '@angular/core'; - 切换加载状态: - `, +
+ 切换加载状态: + +
+ `, styles : [] }) export class NzDemoSpinNestedComponent {