Angular · Junior · Question 63 of 75
How do you format a date in a template?
{{ order.createdAt | date: 'dd.MM.yyyy' }}- ✓Correct answer: With the built-in
datepipe and a format - 2Only by formatting it in the component class
- 3With
{{ order.createdAt.format() }}
Explanation
Built-in pipes like date, currency, number and percent use the app's locale. Pipes are imported into standalone components (e.g. DatePipe).