Skip to content

Commit

Permalink
added ngDestroy on modal
Browse files Browse the repository at this point in the history
Signed-off-by: chaitali-mane <cmane@progress.com>
  • Loading branch information
chaitali-mane committed Mar 5, 2021
1 parent 6631a81 commit 731d5ac
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnInit } from '@angular/core';
import { Component, EventEmitter, Input, OnDestroy, OnInit } from '@angular/core';
import { IdMapper } from 'app/helpers/auth/id-mapper';
import { Store } from '@ngrx/store';
import { FormBuilder, Validators, FormGroup } from '@angular/forms';
Expand All @@ -16,7 +16,7 @@ import { saveAs } from 'file-saver';
templateUrl: './create-client-modal.component.html',
styleUrls: ['./create-client-modal.component.scss']
})
export class CreateClientModalComponent implements OnInit {
export class CreateClientModalComponent implements OnInit, OnDestroy {
@Input() openEvent: EventEmitter<boolean>;
@Input() serverId: string;
@Input() orgId: string;
Expand Down Expand Up @@ -82,6 +82,11 @@ export class CreateClientModalComponent implements OnInit {
});
}

ngOnDestroy(): void {
this.isDestroyed.next(true);
this.isDestroyed.complete();
}

handleNameInput(event: KeyboardEvent): void {
if (!this.isNavigationKey(event)) {
this.conflictError = false;
Expand Down

0 comments on commit 731d5ac

Please sign in to comment.