feat(components): add a tree view page

This commit is contained in:
Alexander Zhukov 2017-05-19 14:40:20 +03:00
parent cf23f972d1
commit a3dede33cf
13 changed files with 109 additions and 8 deletions

View file

@ -0,0 +1,10 @@
<div class="row">
<div class="col-md-6">
<nga-card>
<nga-card-header>Tree</nga-card-header>
<nga-card-body>
<tree [tree]="tree"></tree>
</nga-card-body>
</nga-card>
</div>
</div>

View file

@ -0,0 +1,33 @@
import { Component } from '@angular/core';
import { TreeModel } from 'ng2-tree';
@Component({
selector: 'ngx-tree',
templateUrl: './tree.component.html',
})
export class TreeComponent {
tree: TreeModel = {
value: 'Programming languages by programming paradigm',
children: [{
value: 'Object-oriented programming',
children: [{
value: 'Java',
}, {
value: 'C++',
}, {
value: 'C#',
}],
}, {
value: 'Prototype-based programming',
children: [{
value: 'JavaScript',
}, {
value: 'CoffeeScript',
}, {
value: 'Lua',
}],
}],
};
}