Just setting this up:
app.config(['$routeProvider',function($routeProvider) {
$routeProvider
.when('/asd/:id/:slug',{
templateUrl:'views/home/index.html',
controller:'Home',
publicAccess:true,
sessionAccess:true
});
:id and :slug are both dynamic parameters.
Now, I want to
validate if the current URL matches
that particular route (/asd/:id/:slug
)
For instance, consider the URL: asd/5/it-is-a-slug
What is the simplest way to achieve this?
I tried the following:
$rootScope.$on('$routeChangeStart', function(){
console.log($route.current);
});
However, sometimes it doesn't log anything in the console while switching between page routes.