Below is the directive code and service code. How to call a directive inside the service.And how to call dynamic templates
Directive Code
angular.module('TestModule').directive('mymodalwindow', function () {
return {
restrict: 'E',
template: '<div class="modal-header">' +
'<h3>{{modalOptions.headerText}}</h3>' +
'</div>' +
};
});
Service Code
angular.module('TestModule').service('modalService', ['$modal',
function ($modal) {
var modalDefaults = {
backdrop: true,
keyboard: true,
modalFade: true,
template://How to call the above define directive here?? 1 way is <mymodalwindow></mymodalwindow> But how to pass the directives instead of giving fixed directive name
};}
]);