Skip to content

Commit b283902

Browse files
committed
As of Module 12
1 parent 2a9ae87 commit b283902

File tree

7 files changed

+59
-26
lines changed

7 files changed

+59
-26
lines changed

APM-CLI-Final/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# APM
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.1.2.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.2.0.
44

55
## Development server
66

APM-CLI-Final/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,21 @@
2727
"zone.js": "^0.8.4"
2828
},
2929
"devDependencies": {
30-
"@angular/cli": "1.1.2",
30+
"@angular/cli": "1.2.0",
3131
"@angular/compiler-cli": "^4.0.0",
3232
"@angular/language-service": "^4.0.0",
33-
"@types/jasmine": "2.5.45",
33+
"@types/jasmine": "~2.5.53",
34+
"@types/jasminewd2": "~2.0.2",
3435
"@types/node": "~6.0.60",
3536
"codelyzer": "~3.0.1",
3637
"jasmine-core": "~2.6.2",
3738
"jasmine-spec-reporter": "~4.1.0",
3839
"karma": "~1.7.0",
3940
"karma-chrome-launcher": "~2.1.1",
4041
"karma-cli": "~1.0.1",
42+
"karma-coverage-istanbul-reporter": "^1.2.1",
4143
"karma-jasmine": "~1.1.0",
4244
"karma-jasmine-html-reporter": "^0.2.2",
43-
"karma-coverage-istanbul-reporter": "^1.2.1",
4445
"protractor": "~5.1.2",
4546
"ts-node": "~3.0.4",
4647
"tslint": "~5.3.2",

APM-CLI-Final/src/app/app.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Component } from '@angular/core';
22

3-
import { ProductService } from './products/product.service';
4-
53
@Component({
64
selector: 'pm-root',
75
template: `
@@ -19,8 +17,7 @@ import { ProductService } from './products/product.service';
1917
<router-outlet></router-outlet>
2018
</div>
2119
</div>
22-
`,
23-
providers: [ ProductService ]
20+
`
2421
})
2522
export class AppComponent {
2623
pageTitle: string = 'Acme Product Management';

APM-CLI-Final/src/app/app.module.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
11
import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
3-
import { FormsModule } from '@angular/forms';
43
import { HttpModule } from '@angular/http';
54
import { RouterModule } from '@angular/router';
65

76
import { AppComponent } from './app.component';
8-
import { ProductListComponent } from './products/product-list.component';
9-
import { ConvertToSpacesPipe } from './shared/convert-to-spaces.pipe';
10-
import { StarComponent } from './shared/star.component';
11-
import { ProductDetailComponent } from './products/product-detail.component';
127
import { WelcomeComponent } from './home/welcome.component';
13-
import { ProductGuardService } from './products/product-guard.service';
8+
import { ProductModule } from './products/product.module';
149

1510
@NgModule({
1611
declarations: [
1712
AppComponent,
18-
ProductListComponent,
19-
ConvertToSpacesPipe,
20-
StarComponent,
21-
ProductDetailComponent,
2213
WelcomeComponent
2314
],
2415
imports: [
2516
BrowserModule,
26-
FormsModule,
2717
HttpModule,
2818
RouterModule.forRoot([
29-
{ path: 'products', component: ProductListComponent },
30-
{ path: 'products/:id',
31-
canActivate: [ ProductGuardService ],
32-
component: ProductDetailComponent },
3319
{ path: 'welcome', component: WelcomeComponent },
3420
{ path: '', redirectTo: 'welcome', pathMatch: 'full'},
3521
{ path: '**', redirectTo: 'welcome', pathMatch: 'full'}
36-
])
22+
]),
23+
ProductModule
3724
],
38-
providers: [ProductGuardService],
3925
bootstrap: [AppComponent]
4026
})
4127
export class AppModule { }
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { NgModule } from '@angular/core';
2+
import { ProductListComponent } from './product-list.component';
3+
import { ProductDetailComponent } from './product-detail.component';
4+
import { ConvertToSpacesPipe } from '../shared/convert-to-spaces.pipe';
5+
import { RouterModule } from '@angular/router';
6+
import { ProductGuardService } from './product-guard.service';
7+
import { ProductService } from './product.service';
8+
import { SharedModule } from './../shared/shared.module';
9+
10+
@NgModule({
11+
imports: [
12+
RouterModule.forChild([
13+
{ path: 'products', component: ProductListComponent },
14+
{ path: 'products/:id',
15+
canActivate: [ ProductGuardService ],
16+
component: ProductDetailComponent }
17+
]),
18+
SharedModule
19+
],
20+
declarations: [
21+
ProductListComponent,
22+
ProductDetailComponent,
23+
ConvertToSpacesPipe
24+
],
25+
providers: [
26+
ProductService,
27+
ProductGuardService
28+
]
29+
})
30+
export class ProductModule { }
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { StarComponent } from './star.component';
4+
import { FormsModule } from '@angular/forms';
5+
6+
@NgModule({
7+
imports: [
8+
CommonModule
9+
],
10+
declarations: [
11+
StarComponent
12+
],
13+
exports: [
14+
StarComponent,
15+
CommonModule,
16+
FormsModule
17+
]
18+
})
19+
export class SharedModule { }

APM-CLI-Final/tslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"directive-selector": [
111111
true,
112112
"attribute",
113-
"app",
113+
"pm",
114114
"camelCase"
115115
],
116116
"component-selector": [

0 commit comments

Comments
 (0)