What is the point of using the AngularJS directive in a comment?

Hy, I am wondering what is the point of the AngularJS directive as a comment. I found several examples that work where it displays a warning, even with arguments, but I don't see the point in the directive used as a comment. Can someone please give some specific examples about the meaning of using this function or explain its meaning to me in some other way?

thanks

+4
source share
1 answer

You can use directives as custom tags, attributes, or comments.

For custom tags, older versions of IE have problems with them and need additional code to deal with them. This is pretty well documented on the AngularJS website.

I am not aware of any browsers that have problems with custom attributes, but custom attributes prevent W3C from checking on the page as valid HTML4 or XHTML. If this is important to you, then the possibility of using directives as comments is valuable.

HTML5 allows customization of attributes starting with "data-" to be valid, although this is not a problem for HTML5 pages.

+1
source

Source: https://habr.com/ru/post/1499548/


All Articles