I have in my html file directives
<add /> <back />
and the directives are on the form
.directive('add', ['$window', ...
and
.directive('back', ['$window',
This works fine.
If i change the directives to camel case:
.directive('addPlayer', ['$window', ... <add_player /> <back />
and
<add:player /> <back />
display fine whereas
<add-player /> regular dash <back />
displays only <add-player>
and everything after is not displayed.
Any ideas why?
EDIT:
I've kind of gotten the same behaviour here
http://plnkr.co/edit/cpP4c2TyZwv5Y4BrNUBb?p=preview
The br tag inserts a line break (not a paragraph break). This tag has no content, so it is self closing.
What Does Self-Closing Tag Mean? A self-closing tag is an element of HTML code that has evolved in the language. Typically, the self-closing tag makes use of a “/” character in order to effectively close out a beginning tag enclosed in sideways carets.
You need not close it as it is an empty tag. It only has attributes but no content. which of the following is not a self closing tag? <em> is not a self closing tag, em tag is used for emphasis content.
The HTML <embed> tag is used for embedding an external application or interactive content into an HTML document. Note that the <embed> element is an empty element (no closing tag is used).
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 (
<foo></foo>
).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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With