I want to use a http url as templateUrl in my angularjs directive like below:
angular.directive('mydir', function() {
return {
restrict: 'E',
link: function(scope, element, attrs) {
....
},
templateUrl: "example.com/def.html"
}
});
But after changing it to the above url template is not getting visible on the page. Is there any workaround for this.
templateUrl: "http://example.com/def.html"
). Secondly, this would require you to have permission to request that URL via ajax (using CORS). If you look at your network tab of your browser tools, you're likely getting an error. – Mike McCaughan 27 mins ago