Angular Components

ContentChild and ContentChildren in Angular
Angular

ContentChild and ContentChildren in Angular

The ContentChild & ContentChildren are decorators, which we use to Query and get the reference to the Projected Content in the DOM. Projected content is the content that this component receives from a parent component.

Renderer2 in Angular
Angular

Renderer2 Example: Manipulating DOM in Angular

The Renderer2 allows us to manipulate the DOM elements, without accessing the DOM directly. It provides a layer of abstraction between the DOM element and the component code. Using Renderer2 we can create an element, add a text node to it, append child element using the appendchild method., etc. We can also add or remove styles, HTML attributes, CSS Classes & properties, etc. We can also attach and listen to events etc

ElementRef in Angular
Angular

ElementRef in Angular

Angular ElementRef is a wrapper around a native DOM element. In this tutorial, let us explore how to use the ElementRef to manipulate the DOM in Angular Applications.

How to Use ngTemplateOutlet
Angular

How to Use ngTemplateOutlet in Angular

ngTemplateOutlet is a directive. It instantiates a template dynamically using a template reference and context object as parameters. In this guide, we will learn how to use it in Angular. We will show you several ngTemplateOutlet examples to learn from.

Scroll to Top