import { Component } from '@angular/core';
import { TreeNode } from 'primeng/api';
import { MessageService } from 'primeng/api';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
providers: [MessageService],
})
export class AppComponent {
GfG: TreeNode[];
constructor(
private messageService: MessageService
){}
ngOnInit() {
this.GfG = [
{
label: 'Data Structures and Algorithms',type: 'gfg',
expanded: true,
children: [
{
label: 'Data Structures', type: 'gfg',
expanded: true,
children: [
{
label: 'Queue', type: 'gfg'
},
{
label: 'Red-Black Tree', type: 'gfg'
},
],
},
{
label: 'Algorithms', type: 'gfg',
expanded: true,
children: [
{
label: 'Hashing', type: 'gfg'
},
{
label: 'Divide and Conquer', type: 'gfg'
},
],
},
],
},
];
}
}