I am using AngularJS routing for 4 pages for example a,b,c and d but in that page there're lots of link like e,f,g,h
What I want is if I write routing condition for page then it should do routing but if any other link comes like e or f then it should redirect it to particular link like window.top.location = e
because otherwise it show blank pages and search for template
app.config(['$routeProvider', '$locationProvider',
function($routeProvider, $locationProvider) {
$routeProvider
.when('/a', {
templateUrl: base_url+'a.html',
controller: 'a'
})
.when('/b', {
templateUrl: base_url+'b.html',
controller: 'b'
})
.when('/c', {
templateUrl: base_url+'c.html',
controller: 'c'
})
.when('/d', {
templateUrl: base_url+'d.html',
controller: 'd'
}).otherwise({
redirectTo: LINK_IN_WHICH_USER_CLICK;
});
$locationProvider.html5Mode(true);
}])
now the issue is with current code is I am not getting url in which user clicked and 2nd issue is I want it to redirect like window.top.location
so that it refreshed properly and don't show blank page