Netanel Basal

Starting from version 14, Angular adds the option of setting the page title through the router. We can set the title property in our route definition:

There are times when a dynamic title is needed. For example, we might want to show a todo’s title on a todo page. This can be accomplished by passing an injectable that implements a resolver:

We would also like the company name to appear before each title in the application. Luckily, we can provide a custom title strategy and do it automatically for every route:

Follow me on Medium or Twitter to read more about Angular and JS!

--

--

Dates are an integral part of almost every application. Angular provides a date pipe out-of-the-box. The date pipe allows users to convert dates according to predefined or custom Angular date formats. For example:

Using it today is disadvantageous because we load a bunch of code when we can probably achieve the same functionality natively. The Intl.DateTimeFormat API can be used unless there is a special use-case you need that is only supported by Angular.

Let’s use that as the basis for a date pipe:

It can be customized to meet your needs. It supports timezones, locales, and custom formats, among other features.

--

--

Netanel Basal

Netanel Basal

A FrontEnd Tech Lead, blogger, and open source maintainer. The founder of ngneat, husband and father.