(Contacts) Reset the search filter when component destroyed to ensure the search will reset on route changes

This commit is contained in:
sercan 2020-02-13 11:21:21 +03:00
parent f56c989563
commit 2752cd7a45

View File

@ -77,6 +77,9 @@ export class ContactsComponent implements OnInit, OnDestroy
*/ */
ngOnDestroy(): void ngOnDestroy(): void
{ {
// Reset the search
this._contactsService.onSearchTextChanged.next('');
// Unsubscribe from all subscriptions // Unsubscribe from all subscriptions
this._unsubscribeAll.next(); this._unsubscribeAll.next();
this._unsubscribeAll.complete(); this._unsubscribeAll.complete();