Commit a7951e5f by Aino Leppänen

Misc stuff

1 parent 66dfe12c
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
}, },
"devDependencies": { "devDependencies": {
"@angular/cdk": "^5.2.4", "@angular/cdk": "^5.2.4",
"@angular/cli": "^1.7.3", "@angular/cli": "^1.6.5",
"@angular/compiler-cli": "^5.2.9", "@angular/compiler-cli": "^5.2.9",
"@angular/language-service": "^5.2.9", "@angular/language-service": "^5.2.9",
"@types/jasmine": "~2.8.3", "@types/jasmine": "~2.8.3",
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { Routes } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { InfoComponent } from './pages/info/info.component'; import { LoginComponent } from './pages/login/login.component';
/* const appRoutes: Routes = [ /* const appRoutes: Routes = [
{ {
...@@ -32,18 +32,30 @@ import { InfoComponent } from './pages/info/info.component'; ...@@ -32,18 +32,30 @@ import { InfoComponent } from './pages/info/info.component';
{path: 'old', pathMatch: 'prefix', component: OldMoyaComponent}, {path: 'old', pathMatch: 'prefix', component: OldMoyaComponent},
]; */ ]; */
const appRoutes: Routes = [
{ path: '', pathMatch: 'full', redirectTo: 'login' }, 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/info/info.module#InfoModule' }, { path: 'admin', loadChildren: 'app/pages/admin/admin.module#AdminModule' },
{ path: 'user', loadChildren: 'app/pages/info/info.module#InfoModule' }, { path: 'user', loadChildren: 'app/pages/user/user.module#UserModule' },
{ path: 'login', loadChildren: 'app/pages/info/info.module#InfoModule' }, { path: 'login', component: LoginComponent },
{ path: '', pathMatch: 'full', redirectTo: 'login' },
{ path: '**', component: LoginComponent }
]; ];
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule RouterModule.forRoot(
APP_ROUTES,
/* {
enableTracing: true, // <-- debugging purposes only
} */
)
],
exports: [
RouterModule
], ],
declarations: [] providers: [
]
}) })
export class AppRoutingModule { } export class AppRoutingModule { }
<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>
...@@ -3,10 +3,8 @@ import {Router} from '@angular/router'; ...@@ -3,10 +3,8 @@ import {Router} from '@angular/router';
declare var window: any; declare var window: any;
@Component({ @Component({
selector: 'app-root', selector: 'moya-root',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'] styleUrls: ['./app.component.scss']
}) })
...@@ -14,11 +12,11 @@ export class AppComponent { ...@@ -14,11 +12,11 @@ export class AppComponent {
constructor(private router: Router, private zone: NgZone) { constructor(private router: Router, private zone: NgZone) {
window.angularRoute = (url => { /* window.angularRoute = (url => {
zone.run(() => { zone.run(() => {
router.navigateByUrl(url); router.navigateByUrl(url);
}); });
}); }); */
} }
} }
...@@ -7,7 +7,7 @@ import {ViplistComponent} from './viplist/viplist.component'; ...@@ -7,7 +7,7 @@ import {ViplistComponent} from './viplist/viplist.component';
import {AlertModule} from 'ngx-bootstrap'; import {AlertModule} from 'ngx-bootstrap';
import {RouterModule, Routes} from '@angular/router'; import { Router, RouterModule, PreloadAllModules} from '@angular/router';
import {OldMoyaComponent} from './pages/old-moya/old-moya.component'; import {OldMoyaComponent} from './pages/old-moya/old-moya.component';
import {TestComponent} from './test/test.component'; import {TestComponent} from './test/test.component';
import {AdminMenuComponent} from './menu/admin-menu/admin-menu.component'; import {AdminMenuComponent} from './menu/admin-menu/admin-menu.component';
...@@ -15,9 +15,6 @@ import {TopMenuComponent} from './menu/top-menu/top-menu.component'; ...@@ -15,9 +15,6 @@ import {TopMenuComponent} from './menu/top-menu/top-menu.component';
import {LeftMenuComponent} from './menu/left-menu/left-menu.component'; import {LeftMenuComponent} from './menu/left-menu/left-menu.component';
import {InfoMenuComponent} from './menu/info-menu/info-menu.component'; import {InfoMenuComponent} from './menu/info-menu/info-menu.component';
import {UserMenuComponent} from './menu/user-menu/user-menu.component'; import {UserMenuComponent} from './menu/user-menu/user-menu.component';
import {UserComponent} from './pages/user/user.component';
import {InfoComponent} from './pages/info/info.component';
import {AdminComponent} from './pages/admin/admin.component';
import {HttpClientModule, HttpHandler } from '@angular/common/http'; import {HttpClientModule, HttpHandler } from '@angular/common/http';
import { HttpModule } from '@angular/http'; import { HttpModule } from '@angular/http';
import {StaticInjector} from "@angular/core/src/di/injector"; import {StaticInjector} from "@angular/core/src/di/injector";
...@@ -26,29 +23,18 @@ import {CacheService} from "./shared/services/cache.service"; ...@@ -26,29 +23,18 @@ import {CacheService} from "./shared/services/cache.service";
import {MoyaRestModule} from "./moya-rest"; import {MoyaRestModule} from "./moya-rest";
import {SafePipe} from "./shared/pipes/safe.pipe"; import {SafePipe} from "./shared/pipes/safe.pipe";
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { LoginComponent } from './pages/login/login.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, SafePipe,
RouterModule, LoginComponent,
ViplistComponent, AppComponent
OldMoyaComponent,
TestComponent,
TopMenuComponent,
LeftMenuComponent,
AdminMenuComponent,
InfoMenuComponent,
UserMenuComponent,
UserComponent,
InfoComponent,
AdminComponent,
SafePipe
], ],
imports: [ imports: [
BrowserModule,
AppRoutingModule, AppRoutingModule,
CommonModule, CommonModule,
BrowserModule,
FormsModule, FormsModule,
HttpClientModule, HttpClientModule,
AlertModule.forRoot(), AlertModule.forRoot(),
...@@ -58,4 +44,7 @@ import { AppRoutingModule } from './app-routing.module'; ...@@ -58,4 +44,7 @@ import { AppRoutingModule } from './app-routing.module';
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { export class AppModule {
constructor(router: Router) {
console.log('Routes: ', JSON.stringify(router.config, undefined, 2));
}
} }
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
</head> </head>
<head>Hello you are at moya!</head>
<body> <body>
<app-root>Welcome to new MOYA</app-root> <moya-root>Welcome to new MOYA</moya-root>
</body> </body>
</html> </html>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!