12/5/2017 - 4:46 AM

como implementar el login

Notice this is the same as before. There is another router-outlet which refers to the routes of the nested children in MainComponent. Views from HomeComponent, DownloadComponent, and CompareComponent will go in here.


<div class="all-wrapper menu-side with-side-panel">
  <div class="layout-w">

    <mw-side-menu class="desktop-menu menu-side-w menu-activated-on-click"></mw-side-menu>
    <div class="content-w">
      <div class="content-i">


Notice we only place router-outlet, which will hold the view for either MainComponent or LoginComponent, which can be separate

Then in MainComponent:


The key here is that the Routes can have children which is an array of Routes as you can see.

Your app.component.html can look like this:

export const ROUTES: Routes = [
      path: '',
      component: MainComponent,
      children: [
         { path: '', component: HomeComponent },
         { path: 'download', component: DownloadComponent },
         { path: 'compare', component: CompareComponent }
   { path: 'login', component: LoginComponent },

One quick way I can think of is to change the structure of your routes to something like this: