FrontEndTech
  • Introduction
  • ReactJS
    • Ecosystem
    • Refactor Using Functional Decomposition and Reducer Composition
  • AngularJS
    • installation
    • File structure
    • CLI
      • ng g
    • Fundamentals
      • Component
        • Lifecycle
        • Template
      • Decorations
      • Service
      • Pipe
      • Directives
        • NgClass
        • NgStyle
        • NgModel
        • Customized Attribute Directives
        • NgIf
        • NgFor
        • NgSwitch
        • NgForm
        • Customized Structural Directives
      • Module
        • Routing
    • Bindings
      • Property Binding
      • Event Binding
      • Data Binding
      • Attribute Binding
      • Class Binding
      • Style Binding
    • Forms
      • Reactive Form
      • Reactive vs Template
    • build
Powered by GitBook
On this page
  • Angular Pipes
  • Self-define Pipes

Was this helpful?

  1. AngularJS
  2. Fundamentals

Pipe

PreviousServiceNextDirectives

Last updated 5 years ago

Was this helpful?

Pipes are simple functions that accept an input value and return a transformed value. They're easy to apply within template expressions, using the pipe operator (|)

<div>Title through uppercase pipe: {{title | uppercase}}</div>
  • You can chain expressions through multiple pipes.

<div>
  Title through a pipe chain:
  {{title | uppercase | lowercase}}
</div>
  • You can also to a pipe

<div>Birthdate: {{currentHero?.birthdate | date:'longDate'}}</div>

Angular Pipes

Date

<!--output '2015-06-15 05:03 PM GMT+9'-->
<p>The custom date is {{today | date:'yyyy-MM-dd HH:mm a z':'+0900'}}</p>

Self-define Pipes

A class with the @Pipe decorator defines a function that transforms input values to output values for display in a view.

[R]

apply parameters
Pipe API List
https://angular.io/guide/pipes