Category: Angular
-
Step by Step creating Custom Pipe in Angular
Read full article on the Infragistics blog Angular pipes take data as input and transform it to your desired output. For example, using interpolation you are displaying name of the product. Now you want the product name always displayed in the uppercase. You can do this using Angular pipe uppercase. This file contains bidirectional Unicode…
-
How to create Custom Validator for Angular Reactive Forms
Learn full article on the Infragistics blog In this blog post, we will learn to create custom validators in Angular Reactive Forms. If you are new to reactive forms, learn how to create your first Angular reactive form here. Let’s say we have a login form as shown in the listing below. Currently, the form…
-
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.…
-
What are @HostBinding() and @HostListener() in Angular?
Read full article on the Infragistics blog To understand @HostListener and @HostBinding, you should have basic knowledge about directives in Angular. There are three types of directives in Angular: Component Attribute Directive Structural Directive The basic difference between a component and a directive is that a component has a template, whereas an attribute or structural…
-
How to Create Your First Angular Reactive Form
Read full article on the Infragistics blog Out of the box, Angular provides us with two types of forms: Template Driven Forms Reactive Forms In Template Driven Forms, you create controls on the component template and bind data using ngModel. With these, you do not create controls, form objects, or write code to work with…
-
Simplifying Content Projection in Angular
In Angular, content projection is used to project content in a component. Let’s take a closer look at how it works: Content projection allows you to insert a shadow DOM in your component. To put it simply, if you want to insert HTML elements or other components in a component, then you do that using…
-
How to upgrade to latest Angular CLI
To check which version of Angular CLI is installed on your machine, run the command ng –version as shown in the image below: As you see that on my development machine, Angular cli version 1.0.0 is installed. At the time of writing of this post, latest version of Angular CLI was 1.1.3. To upgrade to…
-
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. Components…
-
Simplifying Two-Way Data Binding in Angular
There are three types of data bindings in Angular , they are as follows: Interpolation Event Binding Property Binding If you are coming from Angular 1.X background, you might be wondering that where is the two-way data binding? Remember, when first time you saw AngularJS 1.X demo, and was just blown away by power of…
-
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 to…