Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.

Commit a7c16f7

Browse files
committed
first steps for RC.5 -> modules
1 parent d76cab9 commit a7c16f7

23 files changed

+232
-181
lines changed

angular-cli.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"project": {
3-
"version": "1.0.0-beta.11-webpack",
3+
"version": "1.0.0-beta.11-webpack.2",
44
"name": "book-monkey"
55
},
66
"apps": [

package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15-
"@angular/common": "2.0.0-rc.4",
16-
"@angular/compiler": "2.0.0-rc.4",
17-
"@angular/core": "2.0.0-rc.4",
18-
"@angular/forms": "0.2.0",
19-
"@angular/http": "2.0.0-rc.4",
20-
"@angular/platform-browser": "2.0.0-rc.4",
21-
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
22-
"@angular/router": "3.0.0-beta.2",
15+
"@angular/common": "2.0.0-rc.5",
16+
"@angular/compiler": "2.0.0-rc.5",
17+
"@angular/core": "2.0.0-rc.5",
18+
"@angular/forms": "0.3.0",
19+
"@angular/http": "2.0.0-rc.5",
20+
"@angular/platform-browser": "2.0.0-rc.5",
21+
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
22+
"@angular/router": "3.0.0-rc.1",
2323
"core-js": "^2.4.0",
2424
"reflect-metadata": "0.1.3",
2525
"rxjs": "5.0.0-beta.6",
@@ -30,16 +30,16 @@
3030
"devDependencies": {
3131
"@types/jasmine": "^2.2.30",
3232
"@types/protractor": "^1.5.16",
33-
"angular-cli": "1.0.0-beta.11-webpack",
33+
"angular-cli": "1.0.0-beta.11-webpack.2",
3434
"angular-cli-ghpages": "*",
3535
"book-monkey2-api": "0.1.2",
3636
"codelyzer": "0.0.26",
3737
"jasmine-core": "2.4.1",
3838
"jasmine-spec-reporter": "2.5.0",
3939
"karma": "0.13.22",
4040
"karma-chrome-launcher": "0.2.3",
41-
"karma-coverage": "^1.0.0",
4241
"karma-jasmine": "0.3.8",
42+
"karma-remap-istanbul": "^0.2.1",
4343
"protractor": "3.3.0",
4444
"ts-node": "1.2.1",
4545
"tslint": "3.13.0",

src/app/app.component.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import { Component } from '@angular/core';
2-
import { ROUTER_DIRECTIVES } from '@angular/router';
32

43
@Component({
54
selector: 'app-root',
6-
templateUrl: 'app.component.html',
7-
styleUrls: ['app.component.css'],
8-
directives: [ROUTER_DIRECTIVES]
5+
templateUrl: 'app.component.html'
96
})
107
export class AppComponent { }

src/app/app.module.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { AppComponent } from './app.component';
4+
import { RouterModule } from '@angular/router'
5+
import { IterationRoutes } from './app.routes'
6+
7+
@NgModule({
8+
declarations: [
9+
AppComponent
10+
],
11+
imports: [
12+
BrowserModule,
13+
RouterModule.forRoot(IterationRoutes)
14+
],
15+
providers: [],
16+
bootstrap: [AppComponent]
17+
})
18+
export class AppModule { }

src/app/app.routes.backup.ts

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import { RouterConfig } from '@angular/router';
2+
3+
import { HomeComponent } from './home/home.component';
4+
5+
import { IterationOneComponent } from './book-monkey/iteration-1/iteration-1.component';
6+
import { AppComponent as BookDetailsApp } from './book-monkey/iteration-1/book-details/index';
7+
import { AppComponent as BookListApp } from './book-monkey/iteration-1/book-list/index';
8+
import { AppComponent as BookListRefactoredApp } from './book-monkey/iteration-1/book-list-refactored/index';
9+
10+
import { IterationTwoComponent } from './book-monkey/iteration-2/iteration-2.component';
11+
import { AppComponent as diApp } from './book-monkey/iteration-2/di/index';
12+
import { AppComponent as NavigationApp, AppRoutes as NavigationAppRoutes } from './book-monkey/iteration-2/navigation/index';
13+
14+
import { IterationThreeComponent } from './book-monkey/iteration-3/iteration-3.component';
15+
import { AppComponent as FormsApp, AppRoutes as FormsAppRoutes } from './book-monkey/iteration-3/forms/index';
16+
import { AppComponent as ValidationApp, AppRoutes as ValidationAppRoutes } from './book-monkey/iteration-3/validation/index';
17+
18+
import { IterationFourComponent } from './book-monkey/iteration-4/iteration-4.component';
19+
import { AppComponent as HttpApp, AppRoutes as HttpAppRoutes } from './book-monkey/iteration-4/http/index';
20+
21+
import { IterationFiveComponent } from './book-monkey/iteration-5/iteration-5.component';
22+
import { AppComponent as PipesApp, AppRoutes as PipesAppRoutes } from './book-monkey/iteration-5/pipes/index';
23+
import { AppComponent as DirectivesApp, AppRoutes as DirectivesAppRoutes } from './book-monkey/iteration-5/directives/index';
24+
25+
export const IterationRoutes: RouterConfig = [
26+
{
27+
path: '',
28+
component: HomeComponent
29+
},
30+
{
31+
path: 'iteration-1',
32+
component: IterationOneComponent,
33+
children: [
34+
{
35+
path: '',
36+
redirectTo: 'book-list'
37+
},
38+
{
39+
path: 'book-list',
40+
component: BookListApp,
41+
},
42+
{
43+
path: 'book-list-refactored',
44+
component: BookListRefactoredApp
45+
},
46+
{
47+
path: 'book-details',
48+
component: BookDetailsApp
49+
}
50+
]
51+
},
52+
{
53+
path: 'iteration-2',
54+
component: IterationTwoComponent,
55+
children: [
56+
{
57+
path: '',
58+
redirectTo: 'dependency-injection'
59+
},
60+
{
61+
path: 'dependency-injection',
62+
component: diApp,
63+
},
64+
{
65+
path: 'navigation',
66+
component: NavigationApp,
67+
children: [ ...NavigationAppRoutes ]
68+
}
69+
]
70+
},
71+
{
72+
path: 'iteration-3',
73+
component: IterationThreeComponent,
74+
children: [
75+
{
76+
path: '',
77+
redirectTo: 'form'
78+
},
79+
{
80+
path: 'form',
81+
component: FormsApp,
82+
children: [ ...FormsAppRoutes ],
83+
},
84+
{
85+
path: 'validation',
86+
component: ValidationApp,
87+
children: [ ...ValidationAppRoutes ]
88+
}
89+
]
90+
},
91+
{
92+
path: 'iteration-4',
93+
component: IterationFourComponent,
94+
children: [
95+
{
96+
path: '',
97+
redirectTo: 'http'
98+
},
99+
{
100+
path: 'http',
101+
component: HttpApp,
102+
children: [ ...HttpAppRoutes ],
103+
}
104+
]
105+
},
106+
{
107+
path: 'iteration-5',
108+
component: IterationFiveComponent,
109+
children: [
110+
{
111+
path: '',
112+
redirectTo: 'pipes'
113+
},
114+
{
115+
path: 'pipes',
116+
component: PipesApp,
117+
children: [ ...PipesAppRoutes ],
118+
},
119+
{
120+
path: 'directives',
121+
component: DirectivesApp,
122+
children: [ ...DirectivesAppRoutes ]
123+
}
124+
]
125+
}
126+
];
127+

src/app/app.routes.ts

+9-105
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,31 @@
11
import { RouterConfig } from '@angular/router';
2-
32
import { HomeComponent } from './home/home.component';
43

5-
import { IterationOneComponent } from './book-monkey/iteration-1/iteration-1.component';
6-
import { AppComponent as BookDetailsApp } from './book-monkey/iteration-1/book-details/index';
7-
import { AppComponent as BookListApp } from './book-monkey/iteration-1/book-list/index';
8-
import { AppComponent as BookListRefactoredApp } from './book-monkey/iteration-1/book-list-refactored/index';
9-
10-
import { IterationTwoComponent } from './book-monkey/iteration-2/iteration-2.component';
11-
import { AppComponent as diApp } from './book-monkey/iteration-2/di/index';
12-
import { AppComponent as NavigationApp, AppRoutes as NavigationAppRoutes } from './book-monkey/iteration-2/navigation/index';
13-
14-
import { IterationThreeComponent } from './book-monkey/iteration-3/iteration-3.component';
15-
import { AppComponent as FormsApp, AppRoutes as FormsAppRoutes } from './book-monkey/iteration-3/forms/index';
16-
import { AppComponent as ValidationApp, AppRoutes as ValidationAppRoutes } from './book-monkey/iteration-3/validation/index';
17-
18-
import { IterationFourComponent } from './book-monkey/iteration-4/iteration-4.component';
19-
import { AppComponent as HttpApp, AppRoutes as HttpAppRoutes } from './book-monkey/iteration-4/http/index';
20-
21-
import { IterationFiveComponent } from './book-monkey/iteration-5/iteration-5.component';
22-
import { AppComponent as PipesApp, AppRoutes as PipesAppRoutes } from './book-monkey/iteration-5/pipes/index';
23-
import { AppComponent as DirectivesApp, AppRoutes as DirectivesAppRoutes } from './book-monkey/iteration-5/directives/index';
24-
25-
export const AppRoutes: RouterConfig = [
4+
export const IterationRoutes: RouterConfig = [
265
{
276
path: '',
287
component: HomeComponent
298
},
309
{
3110
path: 'iteration-1',
32-
component: IterationOneComponent,
33-
children: [
34-
{
35-
path: '',
36-
redirectTo: 'book-list'
37-
},
38-
{
39-
path: 'book-list',
40-
component: BookListApp,
41-
},
42-
{
43-
path: 'book-list-refactored',
44-
component: BookListRefactoredApp
45-
},
46-
{
47-
path: 'book-details',
48-
component: BookDetailsApp
49-
}
50-
]
51-
},
11+
loadChildren: 'app/book-monkey/iteration-1/iteration-1.module#IterationOneModule'
12+
}
13+
/*,
5214
{
5315
path: 'iteration-2',
54-
component: IterationTwoComponent,
55-
children: [
56-
{
57-
path: '',
58-
redirectTo: 'dependency-injection'
59-
},
60-
{
61-
path: 'dependency-injection',
62-
component: diApp,
63-
},
64-
{
65-
path: 'navigation',
66-
component: NavigationApp,
67-
children: [ ...NavigationAppRoutes ]
68-
}
69-
]
16+
loadChildren: './book-monkey/iteration-2/iteration-2.module#IterationTwoModule'
7017
},
7118
{
7219
path: 'iteration-3',
73-
component: IterationThreeComponent,
74-
children: [
75-
{
76-
path: '',
77-
redirectTo: 'form'
78-
},
79-
{
80-
path: 'form',
81-
component: FormsApp,
82-
children: [ ...FormsAppRoutes ],
83-
},
84-
{
85-
path: 'validation',
86-
component: ValidationApp,
87-
children: [ ...ValidationAppRoutes ]
88-
}
89-
]
20+
loadChildren: './book-monkey/iteration-3/iteration-3.module#IterationThreeModule'
9021
},
9122
{
9223
path: 'iteration-4',
93-
component: IterationFourComponent,
94-
children: [
95-
{
96-
path: '',
97-
redirectTo: 'http'
98-
},
99-
{
100-
path: 'http',
101-
component: HttpApp,
102-
children: [ ...HttpAppRoutes ],
103-
}
104-
]
24+
loadChildren: './book-monkey/iteration-4/iteration-4.module#IterationFourModule'
10525
},
10626
{
10727
path: 'iteration-5',
108-
component: IterationFiveComponent,
109-
children: [
110-
{
111-
path: '',
112-
redirectTo: 'pipes'
113-
},
114-
{
115-
path: 'pipes',
116-
component: PipesApp,
117-
children: [ ...PipesAppRoutes ],
118-
},
119-
{
120-
path: 'directives',
121-
component: DirectivesApp,
122-
children: [ ...DirectivesAppRoutes ]
123-
}
124-
]
125-
}
28+
loadChildren: './book-monkey/iteration-5/iteration-5.module#IterationFiveModule'
29+
}*/
12630
];
12731

src/app/book-monkey/iteration-1/book-details/book-details/book-details.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Book, Thumbnail } from '../shared/book';
33

44
@Component({
55
selector: 'book-details',
6-
moduleId: module.id,
6+
77
templateUrl: 'book-details.component.html'
88
})
99
export class BookDetailsComponent {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { AppComponent } from './app.component';
4+
5+
@NgModule({
6+
declarations: [
7+
AppComponent
8+
],
9+
imports: [
10+
BrowserModule,
11+
],
12+
providers: [],
13+
bootstrap: [AppComponent]
14+
})
15+
export class AppModule { }

0 commit comments

Comments
 (0)