Skip to content

Commit

Permalink
revert: fix(modal): add typing for modalRef.componentInstance (#2815,
Browse files Browse the repository at this point in the history
#3529)

This reverts commit f450a7c

Fixes #3464
  • Loading branch information
maxokorokov committed Jan 7, 2020
1 parent 3b9307a commit 3ba317c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/modal/modal-ref.ts
Expand Up @@ -30,7 +30,7 @@ export class NgbActiveModal {
/**
* A reference to the newly opened modal returned by the `NgbModal.open()` method.
*/
export class NgbModalRef<T = any> {
export class NgbModalRef {
private _resolve: (result?: any) => void;
private _reject: (reason?: any) => void;

Expand All @@ -39,7 +39,7 @@ export class NgbModalRef<T = any> {
*
* When a `TemplateRef` is used as the content or when the modal is closed, will return `undefined`.
*/
get componentInstance(): T extends new (...args: any[]) => any? InstanceType<T>: undefined {
get componentInstance(): any {
if (this._contentRef && this._contentRef.componentRef) {
return this._contentRef.componentRef.instance;
}
Expand Down
2 changes: 1 addition & 1 deletion src/modal/modal.spec.ts
Expand Up @@ -886,7 +886,7 @@ export class WithSkipTabindexFirstFocusableModalCmpt {
})
class TestComponent {
name = 'World';
openedModal: NgbModalRef<string>;
openedModal: NgbModalRef;
show = true;
@ViewChild('content', {static: true}) tplContent;
@ViewChild('destroyableContent', {static: true}) tplDestroyableContent;
Expand Down
2 changes: 1 addition & 1 deletion src/modal/modal.ts
Expand Up @@ -25,7 +25,7 @@ export class NgbModal {
*
* Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
*/
open<T>(content: T, options: NgbModalOptions = {}): NgbModalRef<T> {
open(content: any, options: NgbModalOptions = {}): NgbModalRef {
const combinedOptions = Object.assign({}, this._config, options);
return this._modalStack.open(this._moduleCFR, this._injector, content, combinedOptions);
}
Expand Down

0 comments on commit 3ba317c

Please sign in to comment.