Commit 1f97a538 by Aino Leppänen

Routing almost works

1 parent ac3368d1
...@@ -4,36 +4,6 @@ import { Routes, RouterModule } from '@angular/router'; ...@@ -4,36 +4,6 @@ import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component'; import { LoginComponent } from './pages/login/login.component';
import { InfoComponent } from './pages/info/info.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 = [ const APP_ROUTES: Routes = [
{ path: 'info', loadChildren: 'app/pages/info/info.module#InfoModule' }, { path: 'info', loadChildren: 'app/pages/info/info.module#InfoModule' },
{ path: 'admin', loadChildren: 'app/pages/admin/admin.module#AdminModule' }, { 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'; ...@@ -26,7 +26,8 @@ import { LoginComponent } from './pages/login/login.component';
declarations: [ declarations: [
SafePipe, SafePipe,
LoginComponent, LoginComponent,
AppComponent AppComponent,
TopMenuComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
......
...@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router'; ...@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
import { AdminComponent } from './admin.component'; import { AdminComponent } from './admin.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'admin', component: AdminComponent } { path: '', component: AdminComponent }
]; ];
@NgModule({ @NgModule({
......
...@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router'; ...@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
import { InfoComponent } from './info.component'; import { InfoComponent } from './info.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'info', component: InfoComponent } { path: '', component: InfoComponent }
]; ];
@NgModule({ @NgModule({
......
...@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router'; ...@@ -3,7 +3,7 @@ import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './login.component'; import { LoginComponent } from './login.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'info', component: LoginComponent } { path: '', component: LoginComponent }
]; ];
@NgModule({ @NgModule({
......
...@@ -3,7 +3,8 @@ import { Routes, RouterModule } from '@angular/router'; ...@@ -3,7 +3,8 @@ import { Routes, RouterModule } from '@angular/router';
import { UserComponent } from './user.component'; import { UserComponent } from './user.component';
const routes: Routes = [ const routes: Routes = [
{ path: 'user', component: UserComponent } { path: '', component: UserComponent },
]; ];
@NgModule({ @NgModule({
...@@ -11,3 +12,15 @@ const routes: Routes = [ ...@@ -11,3 +12,15 @@ const routes: Routes = [
exports: [RouterModule] exports: [RouterModule]
}) })
export class UserRoutingModule { } 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!