I know that the angular directive can be defined in four ways:
'A' - only matches attribute name
'E' - only matches element name
'C' - only matches class name
'M' - only matches comment
For example, a directive with the expression "M":
angular.module('exampleApp', [])
.directive('myDirective', function() {
return {
restrict: 'M',
...
};
});
and declaring a directive in HTML
But why would anyone use a constraint Mfor a directive? I find it really strange. Because if I comment on the code, I do not want it to run. So why is this the case?
source
share