Managing multiple Angular CLI versions on the same computer

The Angular CLI. Who doesn’t love it? When they started this project, I thought to myself: “who needs this?” This is when it didn’t accomplish much and/or was full of bugs. But as the Angular team kept adding more features, it came to a point where I couldn’t resist it anymore. As I started using it for the first time, I quickly realized the power and potential this tool had. Now, I practically can’t live without it.

Adding the same header on every request in Angular

Let me take a guess. You’re working on a new Angular project and you just figured out how to get an access token and included in a REST API request and it just worked. You were pumped up and excited but suddenly you realize that you now want that same token to be included on every request and still keep your code DRY. The problem is, you’re not 100% sure how to do it in Angular or perhaps you don’t know where to start.

Angular Modules

If you’re like the tens of thousands of Angular developers, you probably started learning Angular using a single app module. A lot of times that’s good enough for smaller applications. But there are other times when it makes sense to start splitting up your app into several modules. Here you’ll learn what Angular modules are, how they work, and when having multiple of them make sense. The Basics Angular has been using (and pushing!

Become a master of the famous Angular error: "NullInjectorError: No provider for x"

As I have taught Angular over the years, one of the most frequent problems I get asked about is related to the following error message: NullInjectorError: No provider for x Once you mostly understand Angular, this will be a breeze to fix. A lot of times it will be accompanied by a phrase like “duh, I forgot to do that!". But if you have minimal to no previous experience with Angular, this is an error you could stare at for a while, perhaps even hours, and not make any progress.

Become a master of the famous Angular error: "Can't bind to x since it isn't a known property of y"

Admittedly, the most common and yet most confusing Angular error for a beginner is the dreaded error that reads like this: Can’t bind to x since it isn’t a known property of y Where x is typically a directive you’re trying to use, such as ngModel for example, and y is the name of the HTML tag in which the directive x is in. Let’s walk through a concrete scenario.

Loading Properties from a Backend in Angular

Adding values you might need for external services using environment.ts and/or environment.prod.ts is a great way to get a prototype idea started quite quickly, but it turns out to be the least flexible of all your options. In this article I will explain why using these “environment” files is not optimal and what other alternative we have. So what is the real problem with using environment.ts? Let’s first get something out in the open: using environment.

Caching and Refreshing Using RxJS in Angular

Learning RxJS can be daunting but rewarding. In this post, I will show you how to cache data that doesn’t change too often but adding a way to keep it fresh as often as you need to using RxJS only. There are certainly other ways of doing the same thing, but let’s dive into one way I figured out for a recent task I was working on. Scenario Here’s my scenario.

Angular vs React - Part 3

Which one should you pick? Angular started it all and React is the hottest thing today. But how do they compare and how would you pick the best solution to your needs and circumstances? I will give you my unbiased (yeah, right!) opinion here. What to consider When picking the right solution for your project, several aspects must be considered. It is very common to come across articles from several experts that analyze speed, community, and documentation as important aspects to consider before adopting a solution out of the many competing options.

Angular vs React - Part 2

Which one should you pick? Angular started it all and React is the hottest thing today. But how do they compare and how would you pick the best solution to your needs and circumstances? I will give you my unbiased (yeah, right!) opinion here. What to consider When picking the right solution for your project, several aspects must be considered. It is very common to come across articles from several experts that analyze speed, community, and documentation as important aspects to consider before adopting a solution out of the many competing options.

Angular vs React - Part 1

Which one should you pick? Angular started it all and React is the hottest thing today. But how do they compare and how would you pick the best solution to your needs and circumstances? I will give you my unbiased (yeah, right!) opinion here. What to consider When picking the right solution for your project, there are several aspects that must consider. It is very common to read experts analyze speed, community, and documentation as important aspects to consider before adopting a solution out of the many competing options.