Renderer2 in Angular | Directives | Angular 12+
Вставка
- Опубліковано 8 лют 2022
- 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.
Renderer2 is a class which provides some useful methods to manipulate the DOM without accessing the DOM elements directly. Let's understand the use of Renderer2 with an example in this lecture.
Very well explained for beginners. Short and clear. Thank you. Keep going.
Thank you sir , for saying about security which XSS injection..
#informatic useful ( render2 making a layer of dom give a security)
Done
Just one question here Angular14 features you covered as part of this playlist?
Sir, when we can do this in html file then why we need to do this through directive?
I am following your classes they are good, but one correction in this class, private property in constructor can be used outside-> that is typescript feature not angular.
That's right. Thank you for the correction.
ivy,lazy loading,initializer concepts?