AngularJS Directive Restrict A vs E

后端 未结 7 1555
萌比男神i
萌比男神i 2020-12-12 11:43

I\'m working in a small team, building in AngularJS and trying to maintain some basic standards & best practices; especially given we\'re relatively new with Angular.

相关标签:
7条回答
  • 2020-12-12 12:23

    restrict is for defining the directive type, and it can be A (Attribute), C (Class), E (Element), and M (coMment) , let's assume that the name of the directive is Doc :

    Type : Usage

    A = <div Doc></div>

    C = <div class="Doc"></div>

    E = <Doc data="book_data"></Doc>

    M = <!--directive:Doc -->

    0 讨论(0)
提交回复
热议问题