For a directive like below, is there a way to override the 'templateUrl' property so that instead of myTemplate1.tpl.html myTemplate2.tpl.html can be used? This is because the directive has already been used at other places but for a new requirement the current template cannot be used.
angular.module("myDirective", [])
.directive("myDirective", [function () {
"use strict";
return {
restrict: "E",
replace: true,
scope: {
"property1": "=",
"property2": "="
},
templateUrl: "web-url/myTemplate1.tpl.html"
};
}]);
If you can edit the directive code itself, you can do something like this:
This way all your old directive usages will still work, and you can configure it like this: