Tutorial by Examples

Location is a service that applications can use to interact with a browser's URL. Depending on which LocationStrategy is used, Location will either persist to the URL's path or the URL's hash segment. Location is responsible for normalizing the URL against the application's base href. import {Comp...
The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted. When a new value is emitted, the async pipe marks the component to be checked for changes. When the component gets destroyed, the async pipe unsubscribes automatically to avoid potential memory leaks. ...
To display current version, we can use VERSION from @angular/core package. import { Component, VERSION } from '@angular/core'; @Component({ selector: 'my-app', template: `<h1>Hello {{name}}</h1> <h2>Current Version: {{ver}}</h2> `, }) export class AppCompone...
The currency pipe allows you to work with you data as regular numbers but display it with standard currency formatting (currency symbol, decimal places, etc.) in the view. @Component({ selector: 'currency-pipe', template: `<div> <p>A: {{myMoney | currency:'USD':false}}</p&...

Page 1 of 1