How to Lazy and Dynamically Load a Component in Angular

There are three ways you can use a component in an Angular app. Loading on route change Using as a child component Dynamically loading on demand However, this article focuses on loading a component dynamically and lazily. The main advantage of lazily loading a component is reducing the initial bundle size and only downloading theContinueContinue reading “How to Lazy and Dynamically Load a Component in Angular”

How to dynamically create a Component in Angular

You can read full article on the Infragistics blog In this article, we will learn to create a component dynamically. You may need to load a component dynamically in various scenarios such as want to show a popup modal etc. Let us assume that, we have a component as listed below, which we will loadContinueContinue reading “How to dynamically create a Component in Angular”

Understanding @Output and EventEmitter in Angular

  Read full article on the Infragistics blog Angular is based on a one-directional data flow and does not have two-way data binding. So, how do you get a component to emit an event to another component? In Angular, a component can emit an event using @Output and EventEmitter. Both are parts of the @angular/core.ContinueContinue reading “Understanding @Output and EventEmitter in Angular”

Communication Between Components Using @Input() in Angular

In Angular 2 a component can share data and information with another component by passing data or events. A component can be used inside another component, thus creating a component hierarchy. The component being used inside another component is known as the child component and the enclosing component is known as the parent component. ComponentsContinueContinue reading “Communication Between Components Using @Input() in Angular”

Introduction to Angular Components

A component is a main building block of an Angular  application, and an application may have any number of components. We can consider a component a particular view of the application with its own logic and data. In AngularJS 1.0, there was the concept of controllers, $Scope, and directives to bind data and logic toContinueContinue reading “Introduction to Angular Components”