Skip to content

Commit

Permalink
fix(search): resolve search field component factory (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
nnixaa committed May 23, 2018
1 parent 084391b commit 15cf18d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/framework/theme/components/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
AfterViewInit,
ChangeDetectionStrategy,
Component,
ComponentFactoryResolver,
ComponentRef,
ElementRef,
EventEmitter,
Expand Down Expand Up @@ -196,6 +197,7 @@ export class NbSearchComponent implements OnInit, AfterViewInit, OnDestroy {
private searchType: string = 'rotate-layout';

constructor(private searchService: NbSearchService,
private componentFactoryResolver: ComponentFactoryResolver,
private themeService: NbThemeService,
private router: Router) {
}
Expand Down Expand Up @@ -264,7 +266,8 @@ export class NbSearchComponent implements OnInit, AfterViewInit, OnDestroy {
}

ngAfterViewInit() {
this.themeService.appendToLayoutTop(NbSearchFieldComponent)
const factory = this.componentFactoryResolver.resolveComponentFactory(NbSearchFieldComponent);
this.themeService.appendToLayoutTop(factory)
.subscribe((componentRef: ComponentRef<any>) => {
this.connectToSearchField(componentRef);
});
Expand Down

0 comments on commit 15cf18d

Please sign in to comment.