diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts index d11d1bcbc2..8452a951df 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts @@ -1,3 +1,4 @@ +import { isDevMode } from '@angular/core'; import { SubscriptionService } from '@abp/ng.core'; import { Component, @@ -206,9 +207,7 @@ export class ModalComponent implements OnDestroy { setTimeout(() => { if (!this.abpClose) return; - console.warn( - 'Please use abpClose directive instead of #abpClose template variable. #abpClose will be removed in v5.0', - ); + this.warnForDeprecatedClose(); fromEvent(this.abpClose.nativeElement, 'click') .pipe(takeUntil(this.destroy$)) .subscribe(() => this.close()); @@ -216,4 +215,12 @@ export class ModalComponent implements OnDestroy { this.init.emit(); } + + private warnForDeprecatedClose() { + if (isDevMode()) { + console.warn( + 'Please use abpClose directive instead of #abpClose template variable. #abpClose will be removed in v5.0', + ); + } + } }