title: How do I prevent slashes in URLs from being encoded?
body: <p>I am using <a href="https://angular.io/" rel="nofollow noreferrer">angular 2.0</a>, specifically the <a href="https://angular.io/docs/ts/latest/guide/router.html#" rel="nofollow noreferrer">routing</a> features for the purposes of this question. The way I have set up my routing looks like this.</p>
  
  <pre><code>const routes: Routes = [
      { path : ':filePath', component: ParentDisplayComponent,
          children : [
              { path : 'metadata', component: MetadataDisplayComponent },
              { path : 'data', component : DataDisplayComponent } 
          ]
      }
  ];
  </code></pre>
  
  <p>So as you can see, a url of mine might end up looking like this.</p>
  
  <pre><code>&lt;host&gt;:&lt;port&gt;/#/&lt;file path&gt;/metadata
  </code></pre>
  
  <p>However, because I am making a file browser of sorts, my "file paths" (the initial parameter) look like this.</p>
  
  <pre><code>/foo/bar/baz
  </code></pre>
  
  <p>In order to make this work, I've had to escape the slashes, so now my urls end up looking like this</p>
  
  <pre><code>&lt;host&gt;:&lt;port&gt;/#/%252ffoo%252fbar%252fbaz/metadata
  </code></pre>
  
  <p>I know that this is more or less "fine", but I seriously hate the look of this, and it isn't very user friendly, as far as manually entering the url. Does anyone have any suggestions on how to make my urls more user friendly?  I kind of do need a parent level component that keeps track of the chosen file, which is why I didn't do something like this.</p>
  
  <pre><code>&lt;host&gt;:&lt;port&gt;/#/metadata?path=/foo/bar/baz
  </code></pre>
  
  <p>The reason for this is that I want my app to have a "browser" (similar to windows explorer) on the left side of the screen at all times, with a swappable component in the middle of the screen. Picture something like this.</p>
  
  <pre><code> ___________________________
  |___________________________|
  |       |
  |file a |  ____________________
  |file b |  |swappable component|
  |file c |  ---------------------
  |etc... | 
  </code></pre>
  
  <p>That's probably enough rambling. Does anyone have any ideas as far as making my urls nicer, considering that I must have parameters containing slashes?</p>