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

Commit bb2cad9

Browse files
committed
Course updated to Angular 6
1 parent ec18938 commit bb2cad9

18 files changed

+2181
-1604
lines changed

.angular-cli.json

-57
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
This repository contains the full application of the course Angular and Firebase - Build a Web Application, so this contains the complete application like it will look like at the end of the course.
55

6-
This course repository is updated to Angular v5, there is a Yarn lock file available.
6+
This course repository is updated to Angular 6, there is a Yarn lock file available.
77

88
[Angular and Firebase - Build a Web Application](https://angular-university.io/course/build-an-application-with-angular2)
99

angular.json

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ng4-cli": {
7+
"root": "",
8+
"sourceRoot": "src",
9+
"projectType": "application",
10+
"architect": {
11+
"build": {
12+
"builder": "@angular-devkit/build-angular:browser",
13+
"options": {
14+
"outputPath": "dist",
15+
"index": "src/index.html",
16+
"main": "src/main.ts",
17+
"tsConfig": "src/tsconfig.app.json",
18+
"polyfills": "src/polyfills.ts",
19+
"assets": [
20+
"src/assets",
21+
"src/favicon.ico"
22+
],
23+
"styles": [
24+
"src/styles.css"
25+
],
26+
"scripts": []
27+
},
28+
"configurations": {
29+
"production": {
30+
"optimization": true,
31+
"outputHashing": "all",
32+
"sourceMap": false,
33+
"extractCss": true,
34+
"namedChunks": false,
35+
"aot": true,
36+
"extractLicenses": true,
37+
"vendorChunk": false,
38+
"buildOptimizer": true,
39+
"fileReplacements": [
40+
{
41+
"replace": "src/environments/environment.ts",
42+
"with": "src/environments/environment.prod.ts"
43+
}
44+
]
45+
}
46+
}
47+
},
48+
"serve": {
49+
"builder": "@angular-devkit/build-angular:dev-server",
50+
"options": {
51+
"browserTarget": "ng4-cli:build"
52+
},
53+
"configurations": {
54+
"production": {
55+
"browserTarget": "ng4-cli:build:production"
56+
}
57+
}
58+
},
59+
"extract-i18n": {
60+
"builder": "@angular-devkit/build-angular:extract-i18n",
61+
"options": {
62+
"browserTarget": "ng4-cli:build"
63+
}
64+
},
65+
"test": {
66+
"builder": "@angular-devkit/build-angular:karma",
67+
"options": {
68+
"main": "src/test.ts",
69+
"karmaConfig": "./karma.conf.js",
70+
"polyfills": "src/polyfills.ts",
71+
"tsConfig": "src/tsconfig.spec.json",
72+
"scripts": [],
73+
"styles": [
74+
"src/styles.css"
75+
],
76+
"assets": [
77+
"src/assets",
78+
"src/favicon.ico"
79+
]
80+
}
81+
},
82+
"lint": {
83+
"builder": "@angular-devkit/build-angular:tslint",
84+
"options": {
85+
"tsConfig": [
86+
"src/tsconfig.app.json",
87+
"src/tsconfig.spec.json"
88+
],
89+
"exclude": []
90+
}
91+
}
92+
}
93+
},
94+
"ng4-cli-e2e": {
95+
"root": "",
96+
"sourceRoot": "",
97+
"projectType": "application",
98+
"architect": {
99+
"e2e": {
100+
"builder": "@angular-devkit/build-angular:protractor",
101+
"options": {
102+
"protractorConfig": "./protractor.conf.js",
103+
"devServerTarget": "ng4-cli:serve"
104+
}
105+
},
106+
"lint": {
107+
"builder": "@angular-devkit/build-angular:tslint",
108+
"options": {
109+
"tsConfig": [
110+
"e2e/tsconfig.e2e.json"
111+
],
112+
"exclude": []
113+
}
114+
}
115+
}
116+
}
117+
},
118+
"defaultProject": "ng4-cli",
119+
"schematics": {
120+
"@schematics/angular:component": {
121+
"prefix": "app",
122+
"styleext": "css"
123+
},
124+
"@schematics/angular:directive": {
125+
"prefix": "app"
126+
}
127+
}
128+
}

package.json

+19-17
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,31 @@
1414
},
1515
"private": true,
1616
"dependencies": {
17-
"@angular/animations": "^5.0.0",
18-
"@angular/common": "^5.0.0",
19-
"@angular/compiler": "^5.0.0",
20-
"@angular/core": "^5.0.0",
21-
"@angular/forms": "^5.0.0",
22-
"@angular/http": "^5.0.0",
23-
"@angular/platform-browser": "^5.0.0",
24-
"@angular/platform-browser-dynamic": "^5.0.0",
25-
"@angular/router": "^5.0.0",
26-
"core-js": "^2.4.1",
27-
"rxjs": "^5.5.2",
28-
"zone.js": "^0.8.14",
17+
"@angular/animations": "6.0.0",
18+
"@angular/common": "6.0.0",
19+
"@angular/compiler": "6.0.0",
20+
"@angular/core": "6.0.0",
21+
"@angular/forms": "6.0.0",
22+
"@angular/http": "6.0.0",
23+
"@angular/platform-browser": "6.0.0",
24+
"@angular/platform-browser-dynamic": "6.0.0",
25+
"@angular/router": "6.0.0",
2926
"@types/lodash": "^4.14.36",
3027
"@types/request": "0.0.30",
3128
"angularfire2": "^4.0.0-rc.0",
29+
"core-js": "^2.4.1",
3230
"firebase": "^3.7.4",
3331
"firebase-queue": "^1.5.0",
34-
"lodash": "^4.15.0"
32+
"lodash": "^4.15.0",
33+
"rxjs": "6.1.0",
34+
"rxjs-compat": "^6.0.0-rc.0",
35+
"zone.js": "0.8.26"
3536
},
3637
"devDependencies": {
37-
"@angular/cli": "1.5.0",
38-
"@angular/compiler-cli": "^5.0.0",
39-
"@angular/language-service": "^5.0.0",
38+
"@angular-devkit/build-angular": "~0.6.0",
39+
"@angular/cli": "^6.0.0",
40+
"@angular/compiler-cli": "6.0.0",
41+
"@angular/language-service": "6.0.0",
4042
"@types/jasmine": "~2.5.53",
4143
"@types/jasminewd2": "~2.0.2",
4244
"@types/node": "~6.0.60",
@@ -52,6 +54,6 @@
5254
"protractor": "~5.1.2",
5355
"ts-node": "~3.2.0",
5456
"tslint": "~5.7.0",
55-
"typescript": "~2.4.2"
57+
"typescript": "2.7.2"
5658
}
5759
}

src/app/app.module.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { AppComponent } from './app.component';
55
import {firebaseConfig} from "../environments/firebase.config";
66
import {AngularFireModule} from "angularfire2";
77

8-
import 'rxjs/add/operator/map';
9-
import 'rxjs/add/operator/do';
10-
import 'rxjs/add/operator/switchMap';
8+
9+
10+
1111

1212
import { HomeComponent } from './home/home.component';
1313
import {LessonsService} from "./shared/model/lessons.service";

src/app/course-detail/course-detail.component.css

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
background: #FAFAFA;
55
}
66

7+
.nav-bar button {
8+
margin-right: 5px;
9+
}
10+
711

812
.lessons-list-container {
913
background: #FAFAFA;

src/app/edit-lesson/edit-lesson.component.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
import {tap} from 'rxjs/operators';
13
import { Component, OnInit } from '@angular/core';
24
import {ActivatedRoute} from "@angular/router";
35
import {Lesson} from "../shared/model/lesson";
@@ -15,8 +17,8 @@ export class EditLessonComponent implements OnInit {
1517
constructor(private route: ActivatedRoute,
1618
private lessonsService: LessonsService) {
1719

18-
route.data
19-
.do(console.log)
20+
route.data.pipe(
21+
tap(console.log))
2022
.subscribe(
2123
data => this.lesson = data['lesson']
2224
);

src/app/home/home.component.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
import {tap} from 'rxjs/operators';
13
import { Component, OnInit } from '@angular/core';
24
import {LessonsService} from "../shared/model/lessons.service";
35
import {Lesson} from "../shared/model/lesson";
@@ -18,8 +20,8 @@ export class HomeComponent implements OnInit {
1820
}
1921

2022
ngOnInit() {
21-
this.lessonsService.findAllLessons()
22-
.do(console.log)
23+
this.lessonsService.findAllLessons().pipe(
24+
tap(console.log))
2325
.subscribe(
2426
lessons => this.allLessons = this.filtered = lessons
2527
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
.nav-bar button, tools-bar button {
3+
margin-right: 5px;
4+
}

src/app/lesson-detail/lesson-detail.component.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
import {switchMap} from 'rxjs/operators';
13
import {Component, OnInit} from '@angular/core';
24
import {ActivatedRoute, Router} from "@angular/router";
35
import {LessonsService} from "../shared/model/lessons.service";
@@ -27,12 +29,12 @@ export class LessonDetailComponent implements OnInit {
2729

2830
ngOnInit() {
2931

30-
this.route.params.switchMap(params => {
32+
this.route.params.pipe(switchMap(params => {
3133

3234
const lessonUrl = params['id'];
3335

3436
return this.lessonsService.findLessonByUrl(lessonUrl);
35-
})
37+
}))
3638
.subscribe(lesson => this.lesson = lesson);
3739

3840

0 commit comments

Comments
 (0)