import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: ` <h2>Date Format</h2> <div style="margin-bottom:20px"> <label [for]="d1" align="top">Default Format</label> <eui-datebox #d1 [(ngModel)]="value"></eui-datebox> </div> <div style="margin-bottom:20px"> <label [for]="d2" align="top">yyyy-MM-dd</label> <eui-datebox #d2 [(ngModel)]="value" format="yyyy-MM-dd"></eui-datebox> </div> ` }) export class AppComponent { value = new Date(); }
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);