I want to create a directive that would set a correct url referenced from the directive's template.
datsApp.directive('myDir', function () {
return {
restrict: 'A',
scope: {},
link: function (scope) {
scope.url = link;
},
template: "<span>Click <a href='{{url}}'>here</a> for more info</span>"
};
});
The link variable is a global variable that holds a url and depends on the language and some other settings. If I set link = 'www.google.com', I get it pointing to localhost:8888/somedir/www.google.com
How can I fix this?