From 59c0bf94fa5dc9091679a722611c88869d5f1ad7 Mon Sep 17 00:00:00 2001 From: Ilya Surmay Date: Fri, 5 Jan 2018 16:19:01 +0200 Subject: [PATCH] fix(modal): fix circular dependency warning (#3359) --- src/modal/bs-modal.service.ts | 2 +- src/modal/modal-container.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modal/bs-modal.service.ts b/src/modal/bs-modal.service.ts index 0858b72259..23badd7048 100644 --- a/src/modal/bs-modal.service.ts +++ b/src/modal/bs-modal.service.ts @@ -109,7 +109,7 @@ export class BsModalService { .provide({ provide: BsModalRef, useValue: bsModalRef }) .attach(ModalContainerComponent) .to('body') - .show({ content, isAnimated: this.config.animated }); + .show({ content, isAnimated: this.config.animated, bsModalService: this }); modalContainerRef.instance.level = this.getModalsCount(); bsModalRef.hide = () => { modalContainerRef.instance.hide(); diff --git a/src/modal/modal-container.component.ts b/src/modal/modal-container.component.ts index 5eedd4db9e..7c7fc5660c 100644 --- a/src/modal/modal-container.component.ts +++ b/src/modal/modal-container.component.ts @@ -35,11 +35,11 @@ export class ModalContainerComponent implements OnInit, OnDestroy { isShown = false; level: number; isAnimated: boolean; + bsModalService: BsModalService; private isModalHiding = false; constructor(options: ModalOptions, protected _element: ElementRef, - private bsModalService: BsModalService, private _renderer: Renderer2) { this.config = Object.assign({}, options); }