Use a service
mymodule.service('URL',function(){
this.make=function(){...}
});
mymodule.controller($scope,URL){
$scope.URL=URL;
}
<a href="{{Url.make(somedata)}}"/>
A service will make you controller more testable AND you'll be able to test the service in isolation. It's more difficult if you add anything to the rootscope in the angular.run method.