How to redirect current page to other URL depending on current URL? -
i want check current url , if not home page, want redirect page particular url using jquery or angularjs
[angular] try following lines of code:
var location = $location.path(); location = location.slice(1, location.indexof("/")); location = location.tolowercase(); if (location != 'home') { $location.path('/redirect/somewhere'); }
wiki
Comments
Post a Comment