title: Angular js - check if current url matches the route (with dynamic url params)
body: <p>i'm simply doing setting this:</p>
  
  <pre><code>app.config(['$routeProvider',function($routeProvider) {
    $routeProvider
    .when('/asd/:id/:slug',{
      templateUrl:'views/home/index.html',
      controller:'Home',
      publicAccess:true,
      sessionAccess:true
    });
  </code></pre>
  
  <p><strong>:id and :slug are dynamic params.</strong></p>
  
  <p>Now i would like to <code>check if current url matches</code> that route (<code>/asd/:id/:slug</code>)</p>
  
  <p>for example the url : <code>asd/5/it-is-a-slug</code></p>
  
  <p>which is the simplest way? </p>
  
  <p>i tryed this :</p>
  
  <pre><code>$rootScope.$on('$routeChangeStart', function(){ 
     console.log($route.current); 
  });
  </code></pre>
  
  <p>but sometimes it returns nothing in console while switching page routes</p>