minor changes

This commit is contained in:
Maria Teresa Paratore 2023-09-21 10:47:52 +02:00
parent e9d54e8f37
commit 970b8b87d2
1 changed files with 17 additions and 4 deletions

View File

@ -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()));
}