ExpressionChangedAfterItHasBeenCheckedError Explained

A lot of understanding came once I understood the Angular Lifecycle Hooks and their relationship with change detection. I was trying to get Angular to update a global flag bound to the *ngIf of an element, and I was trying to change that flag inside of the ngOnInit() life cycle hook of another component. According … Read more

Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’

RC6/RC7/Final release FIX To fix this error, you just need to import ReactiveFormsModule from @angular/forms in your module. Here’s the example of a basic module with ReactiveFormsModule import: To explain further, formGroup is a selector for directive named FormGroupDirective that is a part of ReactiveFormsModule, hence the need to import it. It is used to … Read more

AngularJS vs Angular [closed]

Let me preface by saying, I’m assuming you and everyone who will be reading this is already comfortably with Angular 1 (now referred to as AngularJS, as opposed to simply Angular for the newer versions). That being said, let’s get into some of the additions and key differences in Angular 2+. They added an angular … Read more

Difference between Constructor and ngOnInit

The Constructor is a default method of the class that is executed when the class is instantiated and ensures proper initialisation of fields in the class and its subclasses. Angular, or better Dependency Injector (DI), analyses the constructor parameters and when it creates a new instance by calling new MyClass() it tries to find providers … Read more

Can not find module “@angular-devkit/build-angular”

Using npm, I followed the getting started directions on the Angular CLI quick start page. Angular CLI Quickstart Running ng serve –open after creating and going into my new project “frontend” gave this error: I have tried suggestions from the other question similar to mine but it did not work. Answer was to run npm … Read more