Здесь я устанавливаю Angular - EJ2 Tree view. Я должен добавить «путь» в качестве имени свойства DataSource, которое должно быть указано в nodeData узлов дерева. Вот мой код
getArticleFolderTree(art_data) {
this.articleviewservice
.postArticleData(this._global.APIUrl + "get-article-folder", art_data)
.subscribe(response => {
this.folder_nodes = {
dataSource: response.file_list,
id: 'id',
parentID: 'pid',
path: 'path',
text: 'name',
hasChildren: 'hasChild',
child: 'children',
iconCss: 'icon'
};
});
}
<ejs-treeview #foldertree *ngIf="view_folder_list"
[fields]='folder_nodes' (nodeSelected)='clickMe($event)'>
</ejs-treeview>
public clickMe(args: any): void {
console.log(args); // here I need path from args.nodeData.path .
}
Некоторые свойства не перечислены в nodeData. Я хочу получить путь от nodeData.