Angular — Utilizing custom pure pipe to improve performance

@Pipe({name: 'trim'})
export class TrimPipe implements PipeTransform {
transform(value: string): string {
return value.trim();
}
}
@Component({
template: `{{ value | trim }}`,
...
})
export class AppComponent {...}

--

--

--

Web developer from Hong Kong. Most interested in Angular and Vue. Currently working on a Nuxt.js + NestJS project.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

[Angular] ng-content for beginners

Create an API Rest With NestJS

Mobile Development with React Native

AngularJS Modular/Component Design Series — Creating and Loading Your First Component

Semantic UI

SPA Portfolio Journey pt. 1

I built something pretty cool using JavaScript!

Interview Questions — Week 10

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Liu Ting Chun

Liu Ting Chun

Web developer from Hong Kong. Most interested in Angular and Vue. Currently working on a Nuxt.js + NestJS project.

More from Medium

Hasura, GraphQL, and Auto Code Generation With Angular

State machines as the source of truth in a team

Angular vs React vs Vue : Which to choose for your career as a UI developer

A new Approach to i18n in Angular