mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4745] memory leak fixes (#4931)
* fix app-layout component * fix card-view component * fix cloud-layout service * code fixes * code fixes * even more fixes * even more fixes * lint fixes * test fixes * fix code * remove useless pipes * fix code owners * enable spellcheck for cloud components * update test * update test
This commit is contained in:
committed by
Eugenio Romano
parent
e2311ab045
commit
1abb9bfc89
@@ -17,7 +17,7 @@
|
||||
|
||||
import {
|
||||
Component, EventEmitter,
|
||||
Input, OnInit, Output, TemplateRef, ViewEncapsulation
|
||||
Input, OnInit, Output, TemplateRef, ViewEncapsulation, OnDestroy
|
||||
} from '@angular/core';
|
||||
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router, ActivatedRoute, Params } from '@angular/router';
|
||||
@@ -36,6 +36,8 @@ import {
|
||||
} from '../../app-config/app-config.service';
|
||||
import { OauthConfigModel } from '../../models/oauth-config.model';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
enum LoginSteps {
|
||||
Landing = 0,
|
||||
@@ -57,7 +59,7 @@ interface ValidationMessage {
|
||||
class: 'adf-login'
|
||||
}
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
export class LoginComponent implements OnInit, OnDestroy {
|
||||
isPasswordShow: boolean = false;
|
||||
|
||||
/**
|
||||
@@ -127,6 +129,7 @@ export class LoginComponent implements OnInit {
|
||||
data: any;
|
||||
|
||||
private _message: { [id: string]: { [id: string]: ValidationMessage } };
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -175,7 +178,14 @@ export class LoginComponent implements OnInit {
|
||||
this.initFormFieldsDefault();
|
||||
this.initFormFieldsMessagesDefault();
|
||||
}
|
||||
this.form.valueChanges.subscribe((data) => this.onValueChanged(data));
|
||||
this.form.valueChanges
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(data => this.onValueChanged(data));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
submit() {
|
||||
|
Reference in New Issue
Block a user