import { Component } from '@angular/core' ; import { TreeviewI18n } from 'ng2-dropdown-treeview' ; import { I18n } from './i18n' ; import { DefaultTreeviewI18n } from './default-treeview-i18n' ; @ Component ( { selector : 'leo-app' , template : `
<div class="container">
    <h2>Angular 2 dropdown-treeview component demo</h2>
    <hr />
    <br />
    <div class="row">
        <label for="item-category" class="col-3 col-form-label">Language</label>
        <div class="col-9">
            <select class="form-control" [(ngModel)]="language">
                <option value="en">
                    English
                </option>
                <option value="vi">
                    Tiếng Việt
                </option>
            </select>
        </div>
    </div>
    <hr>
    <h4>Example 1: Primary features</h4>
    <leo-book></leo-book>
    <br />
    <h4>Example 2: Performance with 1000 items</h4>
    <leo-room></leo-room>
    <br />
    <h4>Example 3: Using pipe & i18n</h4>
    <leo-city></leo-city>
    <br />
    <h4>Example 4: Tree-view without drop-down & custom TreeviewConfig & custom TreeviewEventParser & custom template</h4>
    <leo-product></leo-product>
</div>
  ` , providers : [ { provide : TreeviewI18n , useClass : DefaultTreeviewI18n } ] } ) export class AppComponent { constructor ( private i18n ) { } set language ( language ) { this . i18n . language = language ; } get language ( ) { return this . i18n . language ; } }