AngularJS element directives not displaying when using self-closing tags

前端 未结 3 1942
情歌与酒
情歌与酒 2020-12-06 04:43

I have in my html file directives



and the directives are on the form

.directive(\'add\', [\'$w         


        
3条回答
  •  星月不相逢
    2020-12-06 04:58

    To lay your question to rest, I am quoting the official statement from the AngularJS team: (sic)

    self-closing or void elements as the html spec defines them are very special to the browser parser. you can't make your own, so for your custom elements you have to stick to non-void elements ().

    this can't be changed in angular.

    - IgorMinar

    source: https://github.com/angular/angular.js/issues/1953#issuecomment-13135021

    Follow the rest of the conversation on AngularJS issue's page where they discuss the possibility of using XHTML for delivering content with self-closing tags that is acceptable to the browser. However do note that it is not fully supported by AngularJS.

提交回复
热议问题