Browse Source

DatePipe,詳細請查閱網路用法

master
HarveyMac 2 years ago
parent
commit
db845bfee2
  1. 4
      src/app/app.component.html
  2. 8
      src/app/app.component.ts

4
src/app/app.component.html

@ -1,3 +1 @@
<div>金額:{{ 25000 | currency }}</div>
<div>CAD 貨幣碼:{{ 25000 | currency: "CAD" }}</div>
<div>貨幣指示格式:{{ 25000 | currency: "EUR":"symbol" }}</div>
UTC時間:{{ now | date: "long":"+0800" }}

8
src/app/app.component.ts

@ -1,10 +1,10 @@
import { Component, VERSION } from '@angular/core';
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
styleUrls: ['./app.component.css'],
})
export class AppComponent {
pi = 3.1415926;
export class AppComponent {
now = new Date();
}
Loading…
Cancel
Save