Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngOnInit() {
this.treeFlattener = new MatTreeFlattener(
this.transformer,
this.getLevel,
this.isExpandable,
this.getChildren
);
this.treeControl = new FlatTreeControl(this.getLevel, this.isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
this.service
.dataSourceChange
.pipe(takeUntil(this.ngUnsubscribe))
.subscribe(data => {
this.dataSource.data = data;
this.checklistSelection.clear();
});
this.service
.selectedValuesChange
.pipe(
filter(values => !!values.length),
takeUntil(this.ngUnsubscribe)
)
.subscribe(values => {
name: node.name,
level: level,
content: node.content,
};
};
treeControl = new FlatTreeControl(
node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(
this.transformer,
node => node.level,
node => node.expandable,
node => node.children);
dataSource = new MatTreeFlatDataSource(this.treeControl,
this.treeFlattener);
constructor(private service: DagDetailService,
private route: ActivatedRoute,
private message_service: MessageService,
private resource_service: DynamicresourceService,
private sanitizer: DomSanitizer
) {
}
ngAfterViewInit() {
let self = this;
this.service.get_code(this.dag).subscribe(res => {
self.dataSource.data = res.items;
});
label: '本用户组及下属用户组的数据'
},
{
value: 'all',
label: '全部数据'
}
];
this.treeFlattener = new MatTreeFlattener(
this.transformer,
this.getLevel,
this.isExpandable,
this.getChildren
);
this.treeControl = new FlatTreeControl(this.getLevel, this.isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
database.dataChange.subscribe(data => {
this.dataSource.data = data;
});
}
export class TreeFlatOverviewExample {
private _transformer = (node: FoodNode, level: number) => {
return {
expandable: !!node.children && node.children.length > 0,
name: node.name,
level: level,
};
}
treeControl = new FlatTreeControl(
node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(
this._transformer, node => node.level, node => node.expandable, node => node.children);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
constructor() {
this.dataSource.data = TREE_DATA;
}
hasChild = (_: number, node: ExampleFlatNode) => node.expandable;
}
constructor(private database: Database) {
this.treeFlattener = new MatTreeFlattener(this.transformer, this._getLevel,
this._isExpandable, this._getChildren);
this.treeControl = new FlatTreeControl(this._getLevel, this._isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
database.dataChange.subscribe(data => this.dataSource.data = data);
}
constructor(private _database: LoadmoreDatabase) {
this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel,
this.isExpandable, this.getChildren);
this.treeControl = new FlatTreeControl(this.getLevel, this.isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
_database.dataChange.subscribe(data => {
this.dataSource.data = data;
});
_database.initialize();
}
constructor(private _database: ChecklistDatabase, private _changeDetectorRef: ChangeDetectorRef) {
this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel,
this.isExpandable, this.getChildren);
this.treeControl = new FlatTreeControl(
this.getLevel, this.isExpandable);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
_database.dataChange.subscribe(data => this.dataSource.data = data);
}
private transformer = (node: any, level: number) => {
return {
expandable: !!node.sub && node.sub.length > 0,
name: node.name,
level,
id: node.name,
numberChildren: !!node.sub ? node.sub.length : 0
};
}
treeControl = new FlatTreeControl(
node => node.level, node => node.expandable);
treeFlattener = new MatTreeFlattener(
this.transformer, node => node.level, node => node.expandable, (node: any) => node.sub);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
hasChild = (_: number, node: PackageNode) => node.expandable || node.level === 0;
constructor(
private activatedRoute: ActivatedRoute,
private router: Router,
private appsClient: AppsClient,
private security: SecurityService,
private downloadFileService: DownloadFileService,
private fb: FormBuilder,
private translate: TranslateService,
private shortcut: ShortcutUtil,
private pageService: PageService
) {
}