Upgrade routing to Angular2.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import { AccountEditModalComponent } from './accountEditModal.component';
|
||||
},
|
||||
template: `
|
||||
<td>
|
||||
<a href="#!/account/{{ account.id }}/operations">{{ account.name }}</a>
|
||||
<a [routerLink]="['/account', account.id, 'operations']">{{ account.name }}</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -56,7 +56,7 @@ import { AccountEditModalComponent } from './accountEditModal.component';
|
||||
<!-- Open account scheduler. -->
|
||||
<a class="btn btn-secondary"
|
||||
[hidden]="!account.id"
|
||||
href="#!/account/{{ account.id }}/scheduler">
|
||||
[routerLink]="['/account', account.id, 'scheduler']">
|
||||
<span class="fa fa-clock-o"></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user