title: How to get first two URL path segments?
body: <p>How to get first two parts of the URL using AngularJS?</p>
  
  <p>For example, I would like to get the two first path of this URL (as <code>admin/password/</code>):</p>
  
  <pre><code>http://localhost:3000/admin/password/57045b10eba5ca1dfd01a8fc4adb4f6c4efc6454b9454514
  </code></pre>