Skip to content

Commit

Permalink
docs(module:modal): update the API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Jun 16, 2020
1 parent 63acf70 commit acc654a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions components/modal/demo/service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* declarations: NzModalCustomComponent */

import { Component, Input, TemplateRef } from '@angular/core';
import { Component, Input, TemplateRef, ViewContainerRef } from '@angular/core';
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';

@Component({
Expand Down Expand Up @@ -57,7 +57,7 @@ export class NzDemoModalServiceComponent {
htmlModalVisible = false;
disabled = false;

constructor(private modal: NzModalService) {}
constructor(private modal: NzModalService, private viewContainerRef: ViewContainerRef) {}

createModal(): void {
this.modal.create({
Expand Down Expand Up @@ -94,6 +94,7 @@ export class NzDemoModalServiceComponent {
const modal = this.modal.create({
nzTitle: 'Modal Title',
nzContent: NzModalCustomComponent,
nzViewContainerRef: this.viewContainerRef,
nzGetContainer: () => document.body,
nzComponentParams: {
title: 'title in component',
Expand Down
2 changes: 1 addition & 1 deletion components/modal/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ The dialog created by the service method `NzModalService.xxx()` will return a `N
|----|----|
| afterOpen | Same as nzAfterOpen but of type Observable<void> |
| afterClose | Same as nzAfterClose, but of type Observable<result:any> |
| open() | Open (display) dialog box. <i>Calling this function will fail if the dialog is already destroyed</i> |
| close() | Close (hide) the dialog. <i>Note: When used for a dialog created as a service, this method will destroy the dialog directly (as with the destroy method)</i> |
| destroy() | Destroy the dialog. <i>Note: Used only for dialogs created by the service (non-service created dialogs, this method only hides the dialog)</i> |
| getContentComponent() | Gets the Component instance in the contents of the dialog for `nzContent`. <i> Note: When the dialog is not initialized (`ngOnInit` is not executed), this function will return `undefined`</i> |
| triggerOk() | Manually trigger nzOnOk |
| triggerCancel() | Manually trigger nzOnCancel |
| updateConfig(config: ModalOptions): void | Update the config |

### ModalButtonOptions (used to customize the bottom button)

Expand Down
2 changes: 1 addition & 1 deletion components/modal/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ constructor(modal: NzModalService) {
|----|----|
| afterOpen | 同nzAfterOpen,但类型为Observable&lt;void&gt; |
| afterClose | 同nzAfterClose,但类型为Observable&lt;result:any&gt; |
| open() | 打开(显示)对话框。<i>若对话框已销毁,则调用此函数将失效</i> |
| close(result: any) | 关闭(隐藏)对话框。<i>注:当用于以服务方式创建的对话框,此方法将直接 销毁 对话框(同destroy方法)</i> |
| destroy(result: any) | 销毁对话框。<i>注:仅用于服务方式创建的对话框(非服务方式创建的对话框,此方法只会隐藏对话框)</i> |
| getContentComponent() | 获取对话框内容中`nzContent`的Component实例instance。<i>注:当对话框还未初始化完毕(`ngOnInit`未执行)时,此函数将返回`undefined`</i> |
| triggerOk() | 手动触发nzOnOk |
| triggerCancel() | 手动触发nzOnCancel |
| updateConfig(config: ModalOptions): void | 更新配置 |

### ModalButtonOptions(用于自定义底部按钮)

Expand Down

0 comments on commit acc654a

Please sign in to comment.