I am struggling to create a method for composing a URL in my class. Here is what I have attempted:
The createLink method takes an ID and returns the corresponding URL:
console.log("before the method");
console.log($scope.createLink )
$scope.createLink = function createLink (id) {
var link = url+ '?idA=' + id;
return link;
};
console.log("after the method");
console.log($scope.createLink);
This is how it is implemented in my HTML page:
<a ng-href="{{ createLink (file.id) }}" target="_blank"><i>
The issue I am facing is that when the console displays the "after the method" value, it does not show the correct URL (such as /user/download...), instead it displays the method itself:
function createLink (id) {
var link = urlDownloadAllegatoDettRend + '?idA=' + id;
return link;
};
with the value of $scope.createLink;
Can anyone provide assistance in resolving this problem?