A Structural directive changes the DOM layout by adding and removing DOM elements.
The asterisk is syntactic sugar for something a bit more complicated
Let’s take for example the
- Angular will wrap the
host element with a
- Angular will transform the
ngIf to be a property binding.
First, let’s understand how to create a structural directive. We are going to implement our simple copy of the
We can use our directive like this:
Let’s explain what is happening piece by piece.
... read the whole story at netbasal.com.
TemplateRef — As the name suggest the
TemplateRef is just a reference to the