Up to now, I have primarily used Directives in the form of Elements
or Attributes
. Is the Comment
style directive simply a matter of personal preference for style?
app.directive('heading', [function () {
return {
replace: true,
restrict: 'M',
template: '<header> <h1>The First Title</h1> <h2>2nd Title</h2> </header>'
};
}])
Directives can be utilized as Element, Attribute, Class, and Comment:
<heading></heading>
<p heading></p>
<div class="heading"></div>
<!-- directive: heading -->
Is this purely a matter of developer readability preferences? Or are there performance discrepancies or other factors at play? Initially, it appears that using comments may limit usability compared to assigning values to an element, adding additional classes to a class, attribute, etc...