From 691e10073cc330b2cfab8c6693440f973ed34314 Mon Sep 17 00:00:00 2001 From: Dmitry Nehaychik <4dmitr@gmail.com> Date: Fri, 2 Feb 2018 14:54:20 +0300 Subject: [PATCH] fix(search): fix search not un-subscribing from events (#185) --- docs/output.json | 29 +------------------ .../components/search/search.component.ts | 4 +-- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/docs/output.json b/docs/output.json index 6ff2cbdfed..3f084028e2 100644 --- a/docs/output.json +++ b/docs/output.json @@ -2656,13 +2656,6 @@ "shortDescription": "", "description": "" }, - { - "name": "componentFactoryResolver", - "type": "ComponentFactoryResolver", - "required": null, - "shortDescription": "", - "description": "" - }, { "name": "router", "type": "Router", @@ -2700,26 +2693,6 @@ "shortDescription": "", "description": "" }, - { - "examples": [], - "params": [ - { - "name": "component", - "type": "any", - "required": null, - "shortDescription": "", - "description": "" - } - ], - "platform": null, - "name": "createAttachedSearch", - "type": [ - "Observable" - ], - "isStatic": false, - "shortDescription": "", - "description": "" - }, { "examples": [], "params": [], @@ -13859,4 +13832,4 @@ "parent": "default" } } -} +} \ No newline at end of file diff --git a/src/framework/theme/components/search/search.component.ts b/src/framework/theme/components/search/search.component.ts index f8e970d45c..5ce3d57fe1 100644 --- a/src/framework/theme/components/search/search.component.ts +++ b/src/framework/theme/components/search/search.component.ts @@ -222,7 +222,7 @@ export class NbSearchComponent implements OnInit, AfterViewInit, OnDestroy { ) .subscribe(event => this.searchService.deactivateSearch(this.searchType, this.tag)); - combineLatest([ + this.activateSearchSubscription = combineLatest([ this.searchFieldComponentRef$, this.searchService.onSearchActivate(), ]) @@ -241,7 +241,7 @@ export class NbSearchComponent implements OnInit, AfterViewInit, OnDestroy { componentRef.changeDetectorRef.detectChanges(); }); - combineLatest([ + this.deactivateSearchSubscription = combineLatest([ this.searchFieldComponentRef$, this.searchService.onSearchDeactivate(), ])