DIRECTIVE - fluorescent Neon tube Sign on brickwork - Front view - 3D rendered royalty free stock picture. Can be used for online banner ads and direct mailers.

Angular Structural Directives

Angular structural directives allow us to change the DOM structure (hence the name). In Angular, we use the *ngIf as a structural directive. Basically, if it evaluates to ‘true’, then the element is inserted into the DOM. If it is ‘false’, the element is removed.

The above div would be inserted into the template’s DOM structure.

We can also use *ngFor, which allows us to use looping logic for DOM structure.

Happy Coding!

Clay Hess

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email
Skip to content