Last active
December 9, 2018 08:10
-
-
Save sekky0905/abbfbdc8dd7d2cac810d229205b03ac3 to your computer and use it in GitHub Desktop.
Angular4(over2~)のロケールとPipe ref: https://qiita.com/Sekky0905/items/565060b4764eb4c68bec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component} from '@angular/core'; | |
@Component({ | |
selector: 'app-root', | |
template: `<p class="today"> | |
本日は、{{today | date}} だ | |
</p> | |
`, | |
styles: [` | |
.today{background-color:yellow} | |
`] | |
}) | |
export class AppComponent { | |
today = Date.now(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {BrowserModule} from '@angular/platform-browser'; | |
import {NgModule, LOCALE_ID} from '@angular/core'; | |
import {AppComponent} from './app.component'; | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], | |
imports: [ | |
BrowserModule], | |
providers: [{provide: LOCALE_ID, useValue: 'ja-JP'}], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment