Skip to content

Commit

Permalink
Merge pull request #303 from maxisam/issue-301
Browse files Browse the repository at this point in the history
fix: #301 'observers' is deprecated.
  • Loading branch information
maxisam authored Mar 11, 2022
2 parents 5fe4457 + 6f3aae4 commit 8301f96
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions projects/ngx-clipboard/src/lib/ngx-clipboard.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Output,
Renderer2
} from '@angular/core';

import { IClipboardResponse } from './interface';
import { ClipboardService } from './ngx-clipboard.service';

Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 8301f96

Please sign in to comment.