Browse Source

refactor: only warn in devMode

pull/8402/head
bnymncoskuner 5 years ago
parent
commit
297e5ad5c9
  1. 13
      npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

13
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',
);
}
}
}

Loading…
Cancel
Save