From 6f3aae4b7d1c066f8ab82a174c38b2f8219868a9 Mon Sep 17 00:00:00 2001 From: maxisam Date: Thu, 10 Mar 2022 20:23:58 -0600 Subject: [PATCH] fix: #301 'observers' is deprecated. --- projects/ngx-clipboard/src/lib/ngx-clipboard.directive.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/projects/ngx-clipboard/src/lib/ngx-clipboard.directive.ts b/projects/ngx-clipboard/src/lib/ngx-clipboard.directive.ts index a6ce626..85bea39 100644 --- a/projects/ngx-clipboard/src/lib/ngx-clipboard.directive.ts +++ b/projects/ngx-clipboard/src/lib/ngx-clipboard.directive.ts @@ -9,7 +9,6 @@ import { Output, Renderer2 } from '@angular/core'; - import { IClipboardResponse } from './interface'; import { ClipboardService } from './ngx-clipboard.service'; @@ -84,13 +83,13 @@ export class ClipboardDirective implements OnInit, OnDestroy { }; if (succeeded) { - if (this.cbOnSuccess.observers.length > 0) { + if (this.cbOnSuccess.observed) { this.ngZone.run(() => { this.cbOnSuccess.emit(response); }); } } else { - if (this.cbOnError.observers.length > 0) { + if (this.cbOnError.observed) { this.ngZone.run(() => { this.cbOnError.emit(response); });