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
Create custom color theme on Angular Material
Most of the time when building an Angular Material application, you will need to customize your color palette, so that you adapt the look of your application to your client’s brand. In this article, we are going to do that customization for an Angular app that uses Angular Material. When you add Angular Material to […]
Deepcopy of JavaScript Objects and Arrays using lodash’s cloneDeep method
While developing JavaScript applications, often we need to make copies of Objects or Arrays containing Objects. Then we want to work with those copies without affecting the original objects. In a common scenario, we are going to deal with a simple, one level Object (an Object without other Objects nested inside), like in the following […]
How to run Angular tests on CI Docker Container with Chrome
In this article, we are going to learn how to run the tests of an Angular solution generated with @angular/cli into a Docker Container without changing any of the initial configuration generated by @angular/cli. This is very important in the context of Continuous Integration workflow when you want to run your tests as you commit […]
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 […]
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 […]
Angular.js share variables between controllers with service
Note: This article applies to Angular 1 and the example is written in ES5. Let’s say you have a directive where you have a button and once clicked you want an event to happen in another directive. The problem is that the two directives have different scopes, so passing the change directly is not possible. […]