How to Add Dynamic Canonical Links in Angular

Search engines serve millions of users per day. Search Engine Optimization[SEO] is an indispensable part of modern web apps. One of the important SEO rules is Canonical URLs. Canonical URLs can help to inform search engines about “duplicate” or identical content appearing on multiple URLs. Adding the canonical URL in the static website is pretty straight forward. Just add a link tag like - <link rel="canonical" href="https://yourLink"> But as we know, the content of most of the single-page apps is dynamic. [Read More]

A simple Time Ago pipe to display relative time in Angular

Often in the web apps, we keep track of the time associated with the other entities of the app like a post posted time, a blog published time, a question asked or answered, and so on. Generally, this data related to time is stored in the database in UTC or ISO format. Angular has an inbuilt pipe for Date, but it does not give us a relative time. At front-end, we need to display these timings in a pleasant human-readable way like some seconds ago, days ago, weeks ago, months ago, years ago, etc. [Read More]