Commit e75c606e authored by dev0tion's avatar dev0tion

Use lazy loading, adjust import and export statements

parent 9de01989
......@@ -4,7 +4,9 @@ import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './login/login.component';
const routes: Routes = [
{ path: 'login', component: LoginComponent}
{ path: 'login', component: LoginComponent},
{ path: 'setup', loadChildren: 'app/setup/setup.module#SetupModule'},
{ path: 'wallet', loadChildren: 'app/wallet/wallet.module#WalletModule'}
];
@NgModule({
......
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { HttpModule } from '@angular/http';
import { SetupModule } from './setup/setup.module';
......@@ -17,12 +18,11 @@ import { GlobalService } from './shared/services/global.service';
@NgModule({
imports: [
AppRoutingModule,
BrowserModule,
ReactiveFormsModule,
FormsModule,
HttpModule,
SetupModule,
WalletModule,
SharedModule.forRoot()
],
declarations: [
......
......@@ -6,6 +6,7 @@ import { CreateComponent } from './create/create.component';
import { RecoverComponent } from './recover/recover.component';
const routes: Routes = [
{ path: '', redirectTo: 'setup', pathMatch: 'full'},
{ path: 'setup', component: SetupComponent },
{ path: 'setup/create', component: CreateComponent },
{ path: 'setup/recover', component: RecoverComponent }
......
import { BrowserModule } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { SetupComponent } from './setup.component';
import { CreateComponent } from './create/create.component';
......@@ -13,8 +11,7 @@ import { RecoverComponent } from './recover/recover.component';
@NgModule({
imports: [
BrowserModule,
FormsModule,
CommonModule,
SetupRoutingModule,
SharedModule
],
......@@ -23,7 +20,7 @@ import { RecoverComponent } from './recover/recover.component';
SetupComponent,
RecoverComponent
],
exports: [ SetupComponent ],
exports: [],
providers: []
})
......
......@@ -26,7 +26,7 @@ export class ApiService {
*/
getWalletFiles(): Observable<any> {
return this.http
.get(this.mockApiUrl + '/wallet/files')
.get(this.webApiUrl + '/wallet/files')
.map((response: Response) => response);
}
......
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
@NgModule({
imports: [CommonModule, RouterModule],
imports: [CommonModule],
declarations: [],
exports: [CommonModule, FormsModule, RouterModule]
exports: []
})
export class SharedModule {
......
......@@ -7,9 +7,10 @@ import { ReceiveComponent } from './receive/receive.component';
import { HistoryComponent } from './history/history.component';
const routes: Routes = [
{ path: '', redirectTo: 'wallet', pathMatch: 'full' },
{ path: 'wallet', component: WalletComponent,
children: [
{ path: '', redirectTo:'send', pathMatch:'full' },
{ path: '', redirectTo:'history', pathMatch:'full' },
{ path: 'send', component: SendComponent},
{ path: 'receive', component: ReceiveComponent},
{ path: 'history', component: HistoryComponent}
......
import { BrowserModule } from '@angular/platform-browser';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { WalletComponent } from './wallet.component';
import { MenuComponent } from './menu/menu.component';
......@@ -10,16 +9,14 @@ import { SendComponent } from './send/send.component';
import { ReceiveComponent } from './receive/receive.component';
import { HistoryComponent } from './history/history.component';
import { SharedModule } from '../shared/shared.module';
import { WalletRoutingModule } from './wallet-routing.module';
@NgModule({
imports: [
BrowserModule,
CommonModule,
FormsModule,
WalletRoutingModule,
SharedModule
ReactiveFormsModule,
WalletRoutingModule
],
declarations: [
WalletComponent,
......@@ -29,9 +26,7 @@ import { WalletRoutingModule } from './wallet-routing.module';
SendComponent,
HistoryComponent
],
exports: [
WalletComponent
]
exports: []
})
export class WalletModule { }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment