Making Styles Work with [innerHtml] in Angular →

In this post, we'll look at how we can apply styles to html content rendered via innerHtml attribute. By default, styles defined in an Angular component only work in that specific component. This is due to the Emulated view encapsulation policy set by Angular. This logical scope is great because…

AZ-900 Exam Practice Questions with Answers →

This is a huge list of practice questions for Microsoft Azure Fundamentals (AZ-900) exam with answers. Question You need to deploy a serverless solution that meets the following requirements: Execution is triggered through an HTTP request.You pay only for the time that your code runs.You do not have to manage…

How to Switch Git Branch with Local Changes →

I find myself working on the wrong branch locally far too many times - enough to write a post about it. If you have been working on the wrong branch, your commit could be blocked by git: Please, commit your changes or stash them before you can switch branches. Git…

How to Queue Messages Sent to LiveAnnouncer →

Angular provides LiveAnnouncer service to trigger screen reader announcements programmatically. It works well in simple scenarios but fails to queue messages when used concurrently. In this post, I will show you how to extend LiveAnnouncer to announce simultaneous messages. Problem demonstration There are many things to consider when it comes…

Automate API Documentation with NSwag →

Producing documentation is a laborious task that most developers dislike. Considering software delivery is an iterative approach, maintaining documentation becomes a full time work, especially for public APIs. For small teams and solo devs, tools like NSwag can do the heavy lifting of creating and maintaining documentation. Benefits of NSwag:…

Enable CORS in .NET Core →

Due to the same-origin policy, most browsers restrict making requests to different domains than the originally served the website. This is a security feature that prevents a harmful site from accessing sensitive data on other sites. If you are developing an API though, cross-origin requests (CORS) are something you want…

5 Angular CLI Tips You Should Know →

As Angular developers, we often interact with the command-line interface (CLI) to scaffold components and manage packages. It is very important to master the CLI to make sure your development flow is smooth. Having developed several Angular applications myself, I have come to realise the 5 tips below. Shorten commands…

How to Use PDFjs to Parse PDF Documents in Angular →

In this post, I'll show you how to parse a PDF document in Angular. We will extract full text content of a PDF file using pdfjs-dist library. Generate a new Angular application, if you do not have one already: ng new PdfReader Install the latest version of pdfjs-dist from npm:…

Monitoring Live Angular Apps with Application Insights →

In this post, I will explain how you can monitor Angular apps using Microsoft Azure Application Insights. It is not unusual for organisations to ignore monitoring single page applications. Usually, back-end applications such as APIs are monitored via logs, CPU and memory usage. When it comes to front-end, there is…

How to Sort Array of Objects by Date in JavaScript →

I recently had to figure out how to use JavaScript sort to order objects by date property. JavaScript sort method is available on array objects in JavaScript. It mutates the array, which means it modifies the elements of the array while sorting. The sort method has excellent support across all…