This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Comment tags are counted as part of the "exactly one root element" for templates for directives with replace mode #9212
Closed
Description
Templates for directives with replace mode to true
can only have one root element, otherwise this error occurs. However, comment tags are also counted in that check. So for example, the following:
app.directive("superman", function() {
return {
restrict: "E",
template: "<!-- Superman directive --><div>Here I am to save the day</div>",
replace: true
}
})
http://codepen.io/anon/pen/bazyI
Causes an error. Maybe this will be considered a won't-fix but our designer guide couldn't comprehend why the template suddenly stopped working when he added a comment. Perhaps comment tags should be ignored from that count.