Browse Source

refactor: only warn in devMode

pull/8402/head
bnymncoskuner 6 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 { SubscriptionService } from '@abp/ng.core';
import { import {
Component, Component,
@ -206,9 +207,7 @@ export class ModalComponent implements OnDestroy {
setTimeout(() => { setTimeout(() => {
if (!this.abpClose) return; if (!this.abpClose) return;
console.warn( this.warnForDeprecatedClose();
'Please use abpClose directive instead of #abpClose template variable. #abpClose will be removed in v5.0',
);
fromEvent(this.abpClose.nativeElement, 'click') fromEvent(this.abpClose.nativeElement, 'click')
.pipe(takeUntil(this.destroy$)) .pipe(takeUntil(this.destroy$))
.subscribe(() => this.close()); .subscribe(() => this.close());
@ -216,4 +215,12 @@ export class ModalComponent implements OnDestroy {
this.init.emit(); 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