In a recent post, we showed off some examples of Angular pipes we use in our base. Now, we’d like to talk about . directives allow you to attach behavior to elements in the DOM and reuse it across your . The framework already comes with a number of convenient directives like NgStyle, NgIf, NgFor, and NgSwitch.

We’ve written over 6 custom directives so far and would like to share the top five that we think you’ll find useful in your project. Just note that the directives in the demos below were intentionally distilled to the bare minimum for clarity and don’t have extensive customization options or destructors/cleanup code. Use them as a starting point.

Source link


Please enter your comment!
Please enter your name here