import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: ` <h2>Basic ComboBox</h2> <label [for]="combo" align="top">Select a value:</label> <eui-combobox #combo [(ngModel)]="value" [data]="data"></eui-combobox> ` }) export class AppComponent { value = 11; data = [ {value: 11, text: 'Mr. Nice'}, {value: 12, text: 'Narco'}, {value: 13, text: 'Bombasto'}, {value: 14, text: 'Celeritas'}, {value: 15, text: 'Magneta'}, {value: 16, text: 'RubberMan'}, {value: 17, text: 'Dynama'}, {value: 18, text: 'Dr IQ'}, {value: 19, text: 'Magma'}, {value: 20, text: 'Tornado'} ]; }
import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { HttpModule } from '@angular/http'; import { EasyUIModule } from 'easyui/easyui/easyui.module'; import { AppComponent } from './app.component'; @NgModule({ bootstrap: [ AppComponent ], declarations: [ AppComponent ], imports: [ FormsModule, BrowserModule, HttpModule, EasyUIModule ] }) export class AppModule { }
import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; enableProdMode(); platformBrowserDynamic().bootstrapModule(AppModule);