<div style="text-align:center">
  <h1>
    Welcome to {{ title }}!
  </h1>
  <p>{{today | date:'yyyy-MM-dd HH:mm:ss' }}</p>
  <p>{{num | number:'1.2-4'}}</p> <!--/接收的参数格式为{最少整数位数}.{最少小数位数}-{最多小数位数} -->
  <p>{{num | number:'1.2-2'}}</p> 
  <p>{{num | number:'1.1-1'}}</p> 
  <p>{{{ "name": "semlinker" }| json }}</p> <!-- Output: { "name": "semlinker" } -->
  <p>{{userinfo| json }}</p> 
  
</div>
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'angulardemo';
  public today=new Date();
  num=12.123456;
  userinfo:any={
    name:' 张三',
    age:24
  };
}

 

 效果图:

angular 管道


 

http://bbs.itying.com/topic/5bf519657e9f5911d41f2a34

 

相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-09-20
  • 2022-12-23
猜你喜欢
  • 2021-04-23
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
相关资源
相似解决方案