Is there a more efficient way to define multiple Angular directives without repeating the same code over and over again? I have numerous directives that share similar structures, such as:
app.directive('note', function () {
return {
restrict: 'E',
transclude: true,
template: '<div class="note"></div>'
}
});
Instead of manually writing out each directive, like note
, introduction
, thing
, is there a method to loop through an array of names and create them in a more concise manner?