Skip to content

Commit 377230c

Browse files
author
Georgii Rychko
committed
refactor(tree menu): extract tree menu as a separate component
1 parent d171504 commit 377230c

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {Component, Input} from 'angular2/core';
2+
import {CORE_DIRECTIVES} from 'angular2/common';
3+
import {Tree} from "./types";
4+
5+
@Component({
6+
selector: 'tree-menu',
7+
directive: [CORE_DIRECTIVES],
8+
template: `
9+
10+
`
11+
})
12+
export class Ng2TreeMenu {
13+
@Input()
14+
private tree: Tree
15+
16+
17+
}

components/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export interface Tree {
2+
value: string;
3+
children: Array<Tree>;
4+
status?: TreeStatus
5+
}
6+
7+
export enum TreeStatus {
8+
New
9+
}

0 commit comments

Comments
 (0)