Commit 1f97a538 by Aino Leppänen

Routing almost works

1 parent ac3368d1
......@@ -4,36 +4,6 @@ import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { InfoComponent } from './pages/info/info.component';
/* const appRoutes: Routes = [
{
path: 'user',
children: [
{path: '', component: UserMenuComponent, outlet: 'left-menu'},
{path: '', pathMatch: 'full', component: UserComponent},
{path: 'old', component: OldMoyaComponent},
]
},
{
path: 'info',
children: [
{path: '', component: InfoMenuComponent, outlet: 'left-menu'},
{path: '', pathMatch: 'full', component: OldMoyaComponent},
{path: 'old', component: OldMoyaComponent},
{path: 'viplist', component: ViplistComponent},
]
},
{
path: 'admin',
children: [
{path: '', component: AdminMenuComponent, outlet: 'left-menu'},
{path: '', pathMatch: 'full', component: AdminComponent},
{path: 'old', component: OldMoyaComponent},
]
},
{path: 'old', pathMatch: 'prefix', component: OldMoyaComponent},
]; */
const APP_ROUTES: Routes = [
{ path: 'info', loadChildren: 'app/pages/info/info.module#InfoModule' },
{ path: 'admin', loadChildren: 'app/pages/admin/admin.module#AdminModule' },
......
<router-outlet></router-outlet>
<div id="top-container">
<div id="left-menu">
<router-outlet name="left-menu"></router-outlet>
</div>
<div id="contentarea">
<div id="topbar">
<top-menu></top-menu>
</div>
<div id="content">
<router-outlet></router-outlet>
</div>
</div>
</div>
\ No newline at end of file
......@@ -26,7 +26,8 @@ import { LoginComponent } from './pages/login/login.component';
declarations: [
SafePipe,
LoginComponent,
AppComponent
AppComponent,
TopMenuComponent
],
imports: [
BrowserModule,
......
......@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
import { AdminComponent } from './admin.component';
const routes: Routes = [
{ path: 'admin', component: AdminComponent }
{ path: '', component: AdminComponent }
];
@NgModule({
......
......@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
import { InfoComponent } from './info.component';
const routes: Routes = [
{ path: 'info', component: InfoComponent }
{ path: '', component: InfoComponent }
];
@NgModule({
......
......@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './login.component';
const routes: Routes = [
{ path: 'info', component: LoginComponent }
{ path: '', component: LoginComponent }
];
@NgModule({
......
......@@ -3,7 +3,8 @@ import { Routes, RouterModule } from '@angular/router';
import { UserComponent } from './user.component';
const routes: Routes = [
{ path: 'user', component: UserComponent }
{ path: '', component: UserComponent },
];
@NgModule({
......@@ -11,3 +12,15 @@ const routes: Routes = [
exports: [RouterModule]
})
export class UserRoutingModule { }
/* { path: 'heroes', redirectTo: '/superheroes' },
{ path: 'hero/:id', redirectTo: '/superhero/:id' },
{ path: 'superheroes', component: HeroListComponent },
{ path: 'superhero/:id', component: HeroDetailComponent }
*/
/* children: [
{path: '', component: UserMenuComponent, outlet: 'left-menu'},
{path: '', pathMatch: 'full', component: UserComponent},
{path: 'old', component: OldMoyaComponent},
] */
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!