DEMO
Consider the following directive:
angular.module(\'MyApp\').directive(\'maybeLink\', function() {
return {
replace: true,
s
You might be able to use a template
function. According to the docs:
You can specify template as a string representing the template or as a function which takes two arguments tElement and tAttrs (described in the compile function api below) and returns a string value representing the template.
function resolveTemplate(tElement, tAttrs) {
}
angular.module('MyApp').directive('maybeLink', function() {
return {
//...
template: resolveTemplate,
//...
};
});