Let’s say you had a syntax like ng lint –format stylish on your package.json before Angular 6. Running this after you update to Angular 6 will result in the following error: Architect command with multiple targets cannot specify overrides. This error is not much of help when you know that before update the linting worked fine. For this […]
Angular 2
Angular Service Worker landed on @angular.cli 1.6
With Angular 5 version having implemented a new Service Worker customized for Angular apps and @angular/cli 1.6 building it into your Angular app, a further step towards Progressive Web Apps has been made. Why is this important? Progressive Web Apps (or PWA) are seen for many years now as the evolution of apps, bound to […]
Fetch data with the new HttpClient on Angular 5
Note: given the semver adopted from now on by Angular team, I will refer to all versions of Angular2+ as Angular. For the old Angular 1.x, I will use AngularJs The new HttpClient on Angular 5 is here to replace the deprecating @angular/http module. The new HttpClientModule will be imported from @angular/common/http. For the purpose of this article, we are going to use […]
Angular how to dynamically inject a component to DOM
Note: given the semver adopted from now on by Angular team, I will refer to all versions of Angular2+ as Angular. For the old Angular 1.x, I will use AngularJs In this post, we’ll take a look on how to dynamically inject a component into the DOM using a directive as a placeholder and ViewContainerRef Angular class. For simplicity, we will declare a new […]
How to apply flex on Angular component
Note: given the semver adopted from now on by Angular team, I will refer to all versions of Angular2+ as Angular. For the old Angular 1.x I will use AngularJS. Supposing you want to use the flexbox CSS property to style your Angular app. So you will have a cascade of flex element that at some […]
Angular Jasmine Karma test when component has own module
Always remember that your TestBed.configureTestingModule() is there on your test to recreate your module the same way is created on the app. Let’s assume that you have a structure like following: – your.component – your-child1.component – your.child2.component -your.pipe -your.module In your.module you will import and declare all your three components and the […]
How to watch for changes an array/object on Angular 2
In the good old days of Angular.js we had the $scope.$watch mechanism to follow the changes in our variables. For Angular 2 all this has been changed for performance reasons. So, you will be left wondering how to watch the changes on your array/object, needed on every application. You start googling for a solution. You […]