Month: April 2020

angular renderer2

How to implement Angular renderer2 with an example

 An angular Renderer2 class is an abstraction provided by Angular in the form of a service that allows manipulating elements in our application without having to touch the DOM directly. In our previous articles, we had learned the pros and cons of using angular elementRef to directly access DOM element manipulation. An Angular app consists mainly …

How to implement Angular renderer2 with an example Read More »

Angular ContentChild and ContentChildren decorator

In Angular, we have different ways of communication between components. We can query and manipulate the child element/component using different decorators that Angular provides, like @ViewChild and @ContentChild depending on where that element might occur. We need to use the angular ContentChild/ContentChildren decorator to work with the elements inside the “ng-content” container. The @ContentChild decorator …

Angular ContentChild and ContentChildren decorator Read More »

Angular viewChildren example

Angular ViewChildren decorator in details

Angular ViewChild and ViewChildren decorator allow us to access and manipulate HTML elements in DOM or the child component by parent component. Angular provides different ways of communication between components. Components can query the content of their templates to locate instances of element/directive/component, which are known as view children. Angular viewChildren decorator declares a reference …

Angular ViewChildren decorator in details Read More »

Scroll to Top