AngularJS Directive Restrict A vs E

后端 未结 7 1698
萌比男神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:20

    Pitfall:

    1. Using your own html element like wont work on IE8 without workaround (https://docs.angularjs.org/guide/ie)
    2. Using your own html elements will make html validation fail.
    3. Directives with equal one parameter can done like this:

    Instead of this:

    We dont use custom html elements, because if this 2 facts.

    Every directive by third party framework can be written in two ways:

    or

    does the same.

提交回复
热议问题