What are different ways to invoke a directive?

Technology CommunityCategory: AngularJSWhat are different ways to invoke a directive?
VietMX Staff asked 3 years ago

There are four methods to invoke a directive in your angular app which are equivalent.

  • As an attribute
<span my-directive></span
  • As a class
    <span class="my-directive: expression;"></span>
* As an element 
```html
<my-directive></my-directive>
  • As a comment
    <!-- directive: my-directive expression -->