Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1f97a538
authored
Apr 01, 2018
by
Aino Leppänen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Routing almost works
1 parent
ac3368d1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
36 deletions
code/moya-angular/src/app/app-routing.module.ts
code/moya-angular/src/app/app.component.html
code/moya-angular/src/app/app.module.ts
code/moya-angular/src/app/pages/admin/admin-routing.module.ts
code/moya-angular/src/app/pages/info/info-routing.module.ts
code/moya-angular/src/app/pages/login/login-routing.module.ts
code/moya-angular/src/app/pages/user/user-routing.module.ts
code/moya-angular/src/app/app-routing.module.ts
View file @
1f97a53
...
...
@@ -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'
},
...
...
code/moya-angular/src/app/app.component.html
View file @
1f97a53
<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
code/moya-angular/src/app/app.module.ts
View file @
1f97a53
...
...
@@ -26,7 +26,8 @@ import { LoginComponent } from './pages/login/login.component';
declarations
:
[
SafePipe
,
LoginComponent
,
AppComponent
AppComponent
,
TopMenuComponent
],
imports
:
[
BrowserModule
,
...
...
code/moya-angular/src/app/pages/admin/admin-routing.module.ts
View file @
1f97a53
...
...
@@ -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
({
...
...
code/moya-angular/src/app/pages/info/info-routing.module.ts
View file @
1f97a53
...
...
@@ -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
({
...
...
code/moya-angular/src/app/pages/login/login-routing.module.ts
View file @
1f97a53
...
...
@@ -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
({
...
...
code/moya-angular/src/app/pages/user/user-routing.module.ts
View file @
1f97a53
...
...
@@ -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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment