Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit aa4d8f9

Browse files
updated all components to lazy loaded
1 parent 73f853e commit aa4d8f9

File tree

11 files changed

+102
-32
lines changed

11 files changed

+102
-32
lines changed

src/app/app.component.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
<div class="app-fullpage">
2-
<md-toolbar color="accent" class="mat-elevation-z6">
2+
<mat-toolbar color="accent" class="mat-elevation-z6">
33
<button md-icon-button (click)="sidenav.toggle()">
4-
<md-icon>
4+
<mat-icon>
55
menu
6-
</md-icon>
6+
</mat-icon>
77
</button>
88
<span class="title"> RxJS Docs </span>
9-
</md-toolbar>
10-
<md-sidenav-container>
11-
<md-sidenav #sidenav>
12-
<md-nav-list (click)="sidenav.toggle()">
13-
<a *ngFor="let menu of menus" md-list-item routerLinkActive="active"
14-
[routerLinkActiveOptions]="menu.options"
15-
[routerLink]="menu.link">
9+
</mat-toolbar>
10+
<mat-sidenav-container>
11+
<mat-sidenav #sidenav>
12+
<mat-nav-list (click)="sidenav.toggle()">
13+
<a *ngFor="let menu of menus" mat-list-item routerLinkActive="active" [routerLinkActiveOptions]="menu.options" [routerLink]="menu.link">
1614
{{menu.title}}
1715
</a>
18-
</md-nav-list>
19-
</md-sidenav>
16+
</mat-nav-list>
17+
</mat-sidenav>
2018
<div class="body-margin">
2119
<router-outlet></router-outlet>
2220
</div>
23-
</md-sidenav-container>
24-
</div>
21+
</mat-sidenav-container>
22+
</div>

src/app/app.module.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
33
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
4-
import { MdToolbarModule, MdSidenavModule, MdIconModule, MdButtonModule, MdListModule } from '@angular/material';
4+
import { MatToolbarModule, MatSidenavModule, MatIconModule, MatButtonModule, MatListModule } from '@angular/material';
55
import { RouterModule } from '@angular/router';
66

77
import { RXJS_DOC_ROUTES } from './app.routing';
88

99
import { AppComponent } from './app.component';
10-
import { OperatorsComponent } from './operators/operators.component';
11-
import { CompaniesComponent } from './companies/companies.component';
12-
import { TeamComponent } from './team/team.component';
13-
import { RxjsComponent } from './rxjs/rxjs.component';
1410

1511
@NgModule({
1612
declarations: [
1713
AppComponent,
18-
OperatorsComponent,
19-
CompaniesComponent,
20-
TeamComponent,
21-
RxjsComponent
2214
],
2315
imports: [
2416
BrowserModule,
2517
BrowserAnimationsModule,
2618
RouterModule.forRoot(RXJS_DOC_ROUTES),
27-
MdToolbarModule,
28-
MdSidenavModule,
29-
MdIconModule,
30-
MdButtonModule,
31-
MdListModule
19+
MatToolbarModule,
20+
MatSidenavModule,
21+
MatIconModule,
22+
MatButtonModule,
23+
MatListModule
3224
],
3325
providers: [],
3426
bootstrap: [AppComponent]

src/app/app.routing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { RxjsComponent } from './rxjs/rxjs.component';
77
import { TeamComponent } from './team/team.component';
88

99
export const RXJS_DOC_ROUTES: Routes = [
10-
{ path: '', component: RxjsComponent },
11-
{ path: 'operators', component: OperatorsComponent },
12-
{ path: 'team', component: TeamComponent },
13-
{ path: 'companies', component: CompaniesComponent },
10+
{ path: '', loadChildren: './rxjs/rxjs.module#RxjsModule' },
11+
{ path: 'operators', loadChildren: './operators/operators.module#OperatorsModule' },
12+
{ path: 'team', loadChildren: './team/team.module#TeamModule' },
13+
{ path: 'companies', loadChildren: './companies/companies.module#CompaniesModule' },
1414
{ path: '**', redirectTo: '' }
1515
];
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
3+
import { CompaniesComponent } from './companies.component';
4+
import { routing } from './companies.routing';
5+
6+
@NgModule({
7+
imports: [routing],
8+
declarations: [CompaniesComponent]
9+
})
10+
export class CompaniesModule { }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ModuleWithProviders } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { CompaniesComponent } from './companies.component';
5+
6+
const routes: Routes = [
7+
{ path: '', component: CompaniesComponent }
8+
];
9+
10+
export const routing: ModuleWithProviders = RouterModule.forChild(routes);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
3+
import { OperatorsComponent } from './operators.component';
4+
import { routing } from './operators.routing';
5+
6+
@NgModule({
7+
imports: [routing],
8+
declarations: [OperatorsComponent]
9+
})
10+
export class OperatorsModule { }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ModuleWithProviders } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { OperatorsComponent } from './operators.component';
5+
6+
const routes: Routes = [
7+
{ path: '', component: OperatorsComponent }
8+
];
9+
10+
export const routing: ModuleWithProviders = RouterModule.forChild(routes);

src/app/rxjs/rxjs.module.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
3+
import { RxjsComponent } from './rxjs.component';
4+
import { routing } from './rxjs.routing';
5+
6+
@NgModule({
7+
imports: [routing],
8+
declarations: [RxjsComponent]
9+
})
10+
export class RxjsModule { }

src/app/rxjs/rxjs.routing.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ModuleWithProviders } from '@angular/core';
2+
import { Routes, RouterModule } from '@angular/router';
3+
4+
import { RxjsComponent } from './rxjs.component';
5+
6+
const routes: Routes = [
7+
{ path: '', component: RxjsComponent }
8+
];
9+
10+
export const routing: ModuleWithProviders = RouterModule.forChild(routes);

src/app/team/team.module.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NgModule } from '@angular/core';
2+
3+
import { TeamComponent } from './team.component';
4+
import { routing } from './team.routing';
5+
6+
@NgModule({
7+
imports: [routing],
8+
declarations: [TeamComponent]
9+
})
10+
export class TeamModule { }

0 commit comments

Comments
 (0)