diff --git a/src/main/webapp/app/rsc-tree/rsc-tree.component.ts b/src/main/webapp/app/rsc-tree/rsc-tree.component.ts index 59fc375..0b5bbba 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.component.ts +++ b/src/main/webapp/app/rsc-tree/rsc-tree.component.ts @@ -46,6 +46,11 @@ export class RscTreeComponent implements OnInit { }*/ ngOnInit(): void { + /* + this.myForm = this.formBuilder.group({ + context: [],}); + */ + this.resLoader.getResourcesByContext().subscribe(res => { this.nestedDataSource.data = res; }); @@ -53,11 +58,18 @@ export class RscTreeComponent implements OnInit { this.ctxLoader.getData().subscribe(res => { this.allContexts = res; console.log('*******numero contesti...', res.length); - this.filteredContexts = this.chooseContextForm.get('namefield')?.valueChanges.pipe( - startWith(''), - map(name => (name ? this.doFilter(name) : this.allContexts.slice())) - ); }); + this.filteredContexts = this.chooseContextForm.get('namefield')?.valueChanges.pipe( + startWith(''), + map(name => (name ? this.doFilter(name) : this.allContexts.slice())) + ); + + /* + this.myForm = this.formBuilder.group({ + context: [], + }); + + */ } hasNestedChild(_: number, node: IResource): boolean { @@ -69,6 +81,7 @@ export class RscTreeComponent implements OnInit { } private doFilter(name: string): IContextNode[] { + //return this.allContexts.filter(ctx => ctx.name.toLowerCase().includes(name.toLowerCase())); return this.allContexts.filter(ctx => ctx.name.toLowerCase().includes(name.toLowerCase())); }