import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: ` <h2>Basic SearchBox</h2> <eui-searchbox #sb style="width:300px" placeholder="Input something here" (search)="onSearch($event)"> <eui-addon> <span *ngIf="sb.value!=null" class="textbox-icon icon-clear" title="Clear value" (click)="sb.value=null"></span> </eui-addon> </eui-searchbox> <p>You are searching: {{value}}</p> ` }) export class AppComponent { value: string; onSearch(event){ this.value = event.value; } }
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);