Pipe in Angular 9.0

0
Pipe in Angular JS:-

It is used to change the properties of ViewData under the Html file, It is also called Filter in Angular JS application,it was renamed as a PIPE angular Framework.


It will be declared under HTML file with angular view attribute or String Interpolation

{{'ram'|uppercase}}


Here are some built-in pipes available with angular −
  • Lowercasepipe
  • Uppercasepipe
  • Datepipe
  • Currencypipe
  • Jsonpipe
  • Percentpipe
  • Decimalpipe
  • Slicepipe

 ......................................................................................................................................................

 Code of TS FIle:-

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-templatedemo',
  templateUrl: './templatedemo.component.html',
  styleUrls: ['./templatedemo.component.css']
})
export class TemplatedemoComponent implements OnInit {
  a
  todaydate = new Date();
  constructor() {
    }

  ngOnInit() {
  }

}

Code of HTML File:-

<span appChangeText>{{'Welcome in Angular JS'|uppercase}}</span>
 <b>{{6589.23 | currency:"USD":true}}</b>
      // Boolean true is used to get the sign of the currency.
      <h1>Date pipe</h1>
      <b>{{todaydate | date:'d/M/y'}}</b>
      <br/>
     
      <b>{{todaydate | date:'longTime'}}</b>
      <h1>Decimal Pipe</h1>
      <b>{{ 454.78787814 | number: '3.1-6' }}</b>


   

Post a Comment

0Comments

POST Answer of Questions and ASK to Doubt

Post a Comment (0)