Skip to content

Instantly share code, notes, and snippets.

@eperedo
Created June 20, 2013 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eperedo/5827820 to your computer and use it in GitHub Desktop.
Save eperedo/5827820 to your computer and use it in GitHub Desktop.
Url filter for angularjs
angular.module('ddsiteApp').filter('url', ['$location', function ($location) {
return function (subUrl, parameter) {
var protocol = window.location.protocol,
host = window.location.host,
pathName = window.location.pathname;
if(pathName === '/') {
}
console.log(protocol + '//' + host + '/#/' + subUrl + '/' + parameter);
return protocol + '//' + host + '/#/' + subUrl + '/' + parameter;
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment