diff --git a/package.json b/package.json
index 5df83e3..9ec518a 100644
--- a/package.json
+++ b/package.json
@@ -44,6 +44,7 @@
"@angular/http": "^4.3.2",
"@angular/platform-browser": "^4.3.2",
"@angular/platform-browser-dynamic": "^4.3.2",
+ "@angular/router": "^4.3.2",
"@angular/upgrade": "^4.3.2",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.29",
"@nsalaun/ng-logger": "^2.0.1",
diff --git a/src/accounts/account.module.ts b/src/accounts/account.module.ts
index c2c5e59..e19d292 100644
--- a/src/accounts/account.module.ts
+++ b/src/accounts/account.module.ts
@@ -4,6 +4,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
+import { RouterModule } from '@angular/router';
import { NgLoggerModule, Level } from '@nsalaun/ng-logger';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
@@ -17,12 +18,16 @@ import { AccountEditModalComponent } from './accountEditModal.component';
import { AccountFormComponent } from './accountForm.component';
import { AccountRowComponent } from './accountRow.component';
import { DailyBalanceService } from './dailyBalance.service';
+import { AccountListState } from './account.states'
@NgModule({
imports: [
HttpClientModule,
CommonModule,
FormsModule,
+ RouterModule.forChild([
+ AccountListState
+ ]),
NgLoggerModule,
ToastrModule,
NgbModule
diff --git a/src/accounts/account.states.ts b/src/accounts/account.states.ts
index e691de6..2b75fc0 100644
--- a/src/accounts/account.states.ts
+++ b/src/accounts/account.states.ts
@@ -1,7 +1,8 @@
// vim: set tw=80 ts=2 sw=2 sts=2 :
+import { AccountListComponent } from './accountList.component';
+
export const AccountListState = {
- name: 'accounts',
- url: '/accounts',
- component: 'accountList'
+ path: 'accounts',
+ component: AccountListComponent
}
diff --git a/src/accounts/accountRow.component.ts b/src/accounts/accountRow.component.ts
index c78516c..0ef93a6 100644
--- a/src/accounts/accountRow.component.ts
+++ b/src/accounts/accountRow.component.ts
@@ -22,7 +22,7 @@ import { AccountEditModalComponent } from './accountEditModal.component';
},
template: `
- {{ account.name }}
+ {{ account.name }}
|
@@ -56,7 +56,7 @@ import { AccountEditModalComponent } from './accountEditModal.component';
+ [routerLink]="['/account', account.id, 'scheduler']">
diff --git a/src/app.component.ts b/src/app.component.ts
new file mode 100644
index 0000000..3ef7f99
--- /dev/null
+++ b/src/app.component.ts
@@ -0,0 +1,18 @@
+// vim: set tw=80 ts=2 sw=2 sts=2 :
+
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'accountant',
+ template: `
+
+
+
+
+
+
+ `
+})
+export class AppComponent { }
diff --git a/src/app.module.ts b/src/app.module.ts
index 5184371..0bab9c5 100644
--- a/src/app.module.ts
+++ b/src/app.module.ts
@@ -4,12 +4,10 @@ import 'reflect-metadata';
require('./main.less');
-import { AppModule as Ng1AppModule } from './app';
-
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-import { UpgradeModule } from '@angular/upgrade/static';
+import { RouterModule } from '@angular/router';
import { NgLoggerModule } from '@nsalaun/ng-logger';
import { ToastrModule } from 'ngx-toastr';
@@ -19,27 +17,37 @@ import { AccountModule } from './accounts/account.module';
import { ScheduleModule } from './scheduler/schedule.module';
import { OperationModule } from './operations/operation.module';
+import { AppComponent } from './app.component';
+
import { ApiBaseURL, LogLevel } from './app.config';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
- UpgradeModule,
AccountModule,
ScheduleModule,
OperationModule,
NgLoggerModule.forRoot(LogLevel),
ToastrModule.forRoot(),
- NgbModule.forRoot()
- ]
+ NgbModule.forRoot(),
+ RouterModule.forRoot([
+ {
+ path: '',
+ redirectTo: '/accounts',
+ pathMatch: 'full'
+ }
+ ], {
+ enableTracing: true,
+ useHash: true
+ })
+ ],
+ declarations: [
+ AppComponent
+ ],
+ bootstrap: [ AppComponent ]
})
export class AppModule {
- constructor(private upgrade: UpgradeModule) { }
-
- ngDoBootstrap() {
- this.upgrade.bootstrap(document.body, [Ng1AppModule.name], { strictDi: false });
- }
+ constructor() {}
}
-
diff --git a/src/index.ejs b/src/index.ejs
index 2292ec3..e69bd09 100644
--- a/src/index.ejs
+++ b/src/index.ejs
@@ -28,14 +28,7 @@
-
-
-
-
+
|