title: Filter action by $routeParams
body: <p>I'm trying to structure my routes similar to the way Rails does. I have some routes setup similar to this:</p>
  
  <pre><code>$routeProvider.when('/posts', {
    controller: 'PostsCtrl',
    templateUrl: '/views/posts.html'
  });
  $routeProvider.when('/posts/new', {
    controller: 'PostsCtrl',
    templateUrl: '/views/posts.html',
    doNew: true
  });
  $routeProvider.when('/posts/:postID', {
    controller: 'PostsCtrl',
    templateUrl: '/views/posts.html'
  });
  $routeProvider.when('/posts/:postID/edit', {
    controller: 'PostsCtrl',
    templateUrl: '/views/posts.html',
    doEdit: true
  });
  </code></pre>
  
  <p><code>PostCtrl</code> has the following at the bottom:</p>
  
  <pre><code>if ($routeParams.doNew) {
    console.log('action: new');
  } else if ($routeParams.doEdit) {
    console.log('action: edit', $routeParams.postID);
  } else if ($routeParams.libraryID) {
    console.log('action: show', $routeParams.postID);
  } else {
    console.log('action: index');
  }
  </code></pre>
  
  <p><code>action: show</code> is printed when the path is <code>/posts/new</code> or <code>/posts/2</code> or <code>/posts/2/edit</code>. What can I filter to have the controller route to the appropriate action?</p>