Custom AngularJS directive including a dash in the name doesn't work

前端 未结 2 1893
后悔当初
后悔当初 2021-01-12 03:38

I\'ve written the following Angular directive that will add the \"required\" attribute to all children:

.directive(\"requireall\", function($compile) {
  ret         


        
2条回答
  •  醉梦人生
    2021-01-12 03:58

    Rename the directive to "requireAll";

    .directive("requireAll",…)
    

    And a directive named abcDef can be used as abc-def in the markup.

提交回复
热议问题