Feature: Lazy loading

Lazy loaded everything
TODO: The cash flow module when clicking on sub-links, it reloads the whole page, it needs to be diagnosed and fixed, this problem also exists in the other modules
TODO: Rename folders and modules such as account to accounts to match the url
This commit is contained in:
Amritanshu
2019-06-12 19:34:50 +05:30
parent fea48e1a3e
commit 72044476a8
184 changed files with 786 additions and 664 deletions

View File

@ -6,16 +6,16 @@ import {ActivatedRoute, Router} from '@angular/router';
import {BehaviorSubject, Observable, of as observableOf} from 'rxjs';
import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators';
import {IssueDataSource} from './issue-datasource';
import {VoucherService} from '../journal/voucher.service';
import {Batch, Inventory, Journal, Voucher} from '../journal/voucher';
import {VoucherService} from '../core/voucher.service';
import {Batch, Inventory, Journal, Voucher} from '../core/voucher';
import * as moment from 'moment';
import {AuthService} from '../auth/auth.service';
import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component';
import {ToasterService} from '../core/toaster.service';
import {IssueDialogComponent} from './issue-dialog.component';
import {BatchService} from '../purchase-return/batch.service';
import {BatchService} from '../core/batch.service';
import {IssueGridService} from './issue-grid.service';
import {CostCentre} from '../cost-centre/cost-centre';
import {CostCentre} from '../core/cost-centre';
import {IssueGridDataSource} from './issue-grid-datasource';
import {Hotkey, HotkeysService} from "angular2-hotkeys";
@ -228,7 +228,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
(result) => {
this.loadVoucher(result);
this.toaster.show('Success', '');
this.router.navigate(['/Issue', result.id]);
this.router.navigate(['/issue', result.id]);
},
(error) => {
this.toaster.show('Danger', error.error);
@ -237,7 +237,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
}
newVoucher() {
this.router.navigate(['/Issue']);
this.router.navigate(['/issue']);
}
getVoucher(): Voucher {
@ -254,7 +254,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
.subscribe(
(result) => {
this.toaster.show('Success', '');
this.router.navigate(['/Issue'], {replaceUrl: true});
this.router.navigate(['/issue'], {replaceUrl: true});
},
(error) => {
this.toaster.show('Danger', error.error);
@ -315,7 +315,7 @@ export class IssueComponent implements OnInit, AfterViewInit, OnDestroy {
}
goToVoucher(id: string) {
this.router.navigate(['/Issue', id]);
this.router.navigate(['/issue', id]);
}
}