title: How to create dynamic route in angular2?
body: <p>I want to create a project with dynamic route that only type name on url and then route will detect the url and create the own route access to that file to display to broswer</p>
  
  <pre><code>import { Routes,RouterModule } from '@angular/router';
  
  const routes: Routes= GetDynamicRoute();
  
  export const routing = RouterModule.forRoot(routes);
  
  function GetDynamicRoute(){
    var results :Array&lt;Object&gt; = Array&lt;Object&gt;();
    var page = 'GET_URL_PARAMATER';
  
    results.push({ path: '' ,loadChildren: 'app/tmp/home.module'});
    results.push({ path: page, loadChildren: 'app/tmp/'+page+'.module' })
    return results 
  }
  </code></pre>