Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Allow passing a value through close. Closes #76.
Browse files Browse the repository at this point in the history
  • Loading branch information
Douglas Ludlow committed Sep 9, 2016
1 parent f948d6e commit 507bf2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ See examples for [npm](https://github.com/dougludlow/ng2-bs3-modal-demo-npm), [S

Opens the modal. Size is optional. Specify `'sm'` for small and `'lg'` for large to override size. Returns a promise that resolves when the modal is completely shown.

- `close(): Promise`
- `close(value?: any): Promise<any>`

Closes the modal. Causes `onClose` to be emitted. Returns a promise that resolves when the modal is completely hidden.
Closes the modal. Causes `onClose` to be emitted. Returns a promise that resolves the value passed to `close` when the modal is completely hidden.

- `dismiss(): Promise`

Expand Down
4 changes: 2 additions & 2 deletions src/ng2-bs3-modal/components/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export class ModalComponent implements OnDestroy {
});
}

close(): Promise<void> {
close(value?: any): Promise<void> {
return this.instance.close().then(() => {
this.onClose.emit(undefined);
this.onClose.emit(value);
});
}

Expand Down

0 comments on commit 507bf2a

Please sign in to comment.