I have developed a versatile directive
that I want to be able to use on any Angular page within our website. I do not want to constrain each page to using the same app
variable. Can someone provide guidance on how I can modify this directive to make it generic so that it can simply be added as a dependency (included in a separate js file, of course)?
var app = angular.module('myapp', []);
app.directive('helloWorld', function() {
return {
restrict: 'AE',
replace: 'true',
scope: {
name: '@',
},
template: '<h3 >Hello {{name}}</h3> ',
}
};
});