This tutorial presumes that you have a basic working knowledge about Angular 8/ 9/ 10.

I have followed another approach to make it more involving. To ideally follow this tutorial copy paste the code snippet on to VS Code saving the file with the appropriate extension and read through the code. I understand that this may be new to you.

Please leave your comments below so that I can understand my audience better.

Angular — Directives

In this section, I will be explaining directives in detail.

Just for the recap, from the previous tutorial, there are three types of directives.

Components
Structural Directives
Attribute Directives

In the  Angular 9 / 10 Basics Tutorial we have already covered Components.

We will be starting from Structural Directives in this Tutorial.

Structural Directives:

  • Looks like a normal HTML attribute has a prefix ‘*’.
  • Affects the DOM.
  • Elements get added or removed in the DOM.

Attribute Directives:

  • They are used as an element in the DOM.
  • Elements in the DOM, are never destroyed in the Attribute Directives, they only change the properties of the HTML element.
  • They only affect / change the element they are added to.

#angular #angularjs #javascript

Angular 10 Directives - Part of Angular Advanced Series
5.65 GEEK