From 2eec364758347bda40a9c243517a6c923ac00704 Mon Sep 17 00:00:00 2001 From: Deyan Kamburov Date: Thu, 18 Nov 2021 22:23:43 +0200 Subject: [PATCH] chore(hgrid): Avoid circular deps in hgrid remote sample --- .../hierarchical-remote.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/hierarchical-grid-remote-virtualization/hierarchical-remote.service.ts b/src/app/hierarchical-grid-remote-virtualization/hierarchical-remote.service.ts index b796640a1a1..6a1c369b335 100644 --- a/src/app/hierarchical-grid-remote-virtualization/hierarchical-remote.service.ts +++ b/src/app/hierarchical-grid-remote-virtualization/hierarchical-remote.service.ts @@ -17,7 +17,9 @@ export class HierarchicalRemoteService { public url = `https://services.odata.org/V4/Northwind/Northwind.svc/Products`; public urlBuilder; - constructor(private http: HttpClient, private hierarchyPipe: IgxGridHierarchicalPipe) { + private hierarchyPipe: IgxGridHierarchicalPipe = null; + + constructor(private http: HttpClient) { this._remoteData = new BehaviorSubject([]); this.remoteData = this._remoteData.asObservable(); } @@ -43,6 +45,7 @@ export class HierarchicalRemoteService { } public getData(virtualizationState: any, grid: IgxHierarchicalGridComponent, cb?: (any) => void) { + this.hierarchyPipe = this.hierarchyPipe ?? new IgxGridHierarchicalPipe(grid); return this.http.get(this.buildUrl(virtualizationState, grid)).pipe( map(response => response), )