-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Asif Ansari
committed
Oct 25, 2018
1 parent
b2e1067
commit a34b61d
Showing
47 changed files
with
161 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
MUST READ: Angular CLI - Latest Version | ||
Section 1, Lecture 5 | ||
Important: In the next lecture, we'll use a tool called the "Angular CLI" to create our Angular project. | ||
|
||
With the latest version, this tool will ask you two questions: | ||
|
||
1) Do you want to use the Angular Router? | ||
|
||
2) Which CSS pre-processor do you want to use? | ||
|
||
Simply hit ENTER twice and confirm the default (without entering any value). | ||
|
||
The defaults (which we will use therefore) are: | ||
|
||
1) No (No router for now, we'll add it later) | ||
|
||
2) CSS |
Binary file not shown.
Binary file added
BIN
+44.4 KB
02. The Angular Frontend - Understanding the Basics/angular-01-basic-list-added.zip
Binary file not shown.
Binary file added
BIN
+45.1 KB
02. The Angular Frontend - Understanding the Basics/angular-02-added-post-form.zip
Binary file not shown.
Binary file added
BIN
+44.5 KB
02. The Angular Frontend - Understanding the Basics/angular-03-finished.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
const app = require("./backend/app"); | ||
const debug = require("debug")("node-angular"); | ||
const http = require("http"); | ||
|
||
const normalizePort = val => { | ||
var port = parseInt(val, 10); | ||
|
||
if (isNaN(port)) { | ||
// named pipe | ||
return val; | ||
} | ||
|
||
if (port >= 0) { | ||
// port number | ||
return port; | ||
} | ||
|
||
return false; | ||
}; | ||
|
||
const onError = error => { | ||
if (error.syscall !== "listen") { | ||
throw error; | ||
} | ||
const bind = typeof port === "string" ? "pipe " + port : "port " + port; | ||
switch (error.code) { | ||
case "EACCES": | ||
console.error(bind + " requires elevated privileges"); | ||
process.exit(1); | ||
break; | ||
case "EADDRINUSE": | ||
console.error(bind + " is already in use"); | ||
process.exit(1); | ||
break; | ||
default: | ||
throw error; | ||
} | ||
}; | ||
|
||
const onListening = () => { | ||
const addr = server.address(); | ||
const bind = typeof port === "string" ? "pipe " + port : "port " + port; | ||
debug("Listening on " + bind); | ||
}; | ||
|
||
const port = normalizePort(process.env.PORT || "3000"); | ||
app.set("port", port); | ||
|
||
const server = http.createServer(app); | ||
server.on("error", onError); | ||
server.on("listening", onListening); | ||
server.listen(port); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Using MongoDB Atlas & IP Whitelist | ||
Section 4, Lecture 48 | ||
By selecting the "Free Sandbox" in the previous video, we're using MongoDB Atlas (https://www.mongodb.com/cloud/atlas) in this course - a hosted MongoDB cluster. | ||
|
||
There, we added our local IP to the "IP Whitelist". One important note on that: If you're away from the project for a couple of days (or maybe even after one day), you might've received a new local IP by your internet provider. Hence you should update that "IP Whitelist" if you're facing any connection issues! |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Section Resources | ||
Section 5, Lecture 70 | ||
Angular Material Docs: https://material.angular.io/components/categories | ||
Resources for this lecture | ||
enhancing-01-added-routing.zip | ||
enhancing-02-added-update-functionality.zip | ||
enhancing-03-finished.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Possible Error | ||
Section 5, Lecture 64 | ||
Important: You might be getting an error ("can't find property title") when you reload the Edit page after/ during the next lecture. | ||
|
||
This is totally normal and will be fixed in lecture 65 :-) | ||
|
||
Max |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+263 KB
06. Adding Image Uploads to our App/image-upload-01-added-file-picker.zip
Binary file not shown.
Binary file added
BIN
+267 KB
06. Adding Image Uploads to our App/image-upload-02-converted-form-added-preview.zip
Binary file not shown.
Binary file added
BIN
+266 KB
06. Adding Image Uploads to our App/image-upload-03-mimetype-validation.zip
Binary file not shown.
Binary file not shown.
44 changes: 44 additions & 0 deletions
44
06. Adding Image Uploads to our App/mime-type.validator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { AbstractControl } from "@angular/forms"; | ||
import { Observable, Observer } from "rxjs"; | ||
|
||
export const mimeType = ( | ||
control: AbstractControl | ||
): Promise<{ [key: string]: any }> | Observable<{ [key: string]: any }> => { | ||
const file = control.value as File; | ||
const fileReader = new FileReader(); | ||
const frObs = Observable.create( | ||
(observer: Observer<{ [key: string]: any }>) => { | ||
fileReader.addEventListener("loadend", () => { | ||
const arr = new Uint8Array(fileReader.result).subarray(0, 4); | ||
let header = ""; | ||
let isValid = false; | ||
for (let i = 0; i < arr.length; i++) { | ||
header += arr[i].toString(16); | ||
} | ||
switch (header) { | ||
case "89504e47": | ||
isValid = true; | ||
break; | ||
case "ffd8ffe0": | ||
case "ffd8ffe1": | ||
case "ffd8ffe2": | ||
case "ffd8ffe3": | ||
case "ffd8ffe8": | ||
isValid = true; | ||
break; | ||
default: | ||
isValid = false; // Or you can use the blob.type as fallback | ||
break; | ||
} | ||
if (isValid) { | ||
observer.next(null); | ||
} else { | ||
observer.next({ invalidMimeType: true }); | ||
} | ||
observer.complete(); | ||
}); | ||
fileReader.readAsArrayBuffer(file); | ||
} | ||
); | ||
return frObs; | ||
}; |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+283 KB
08. Adding User Authentication/authentication-02-added-server-side-signup-login.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+283 KB
08. Adding User Authentication/authentication-04-added-route-guards.zip
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Section Resources | ||
Section 9, Lecture 119 | ||
Mongoose Relations (and how you could combine them when fetching data): http://mongoosejs.com/docs/populate.html | ||
Resources for this lecture | ||
authorization-01-added-user-model.zip | ||
authorization-02-added-server-side-authorization.zip | ||
authorization-03-finished.zip |
Binary file not shown.
Binary file added
BIN
+289 KB
09. Authorization/authorization-02-added-server-side-authorization.zip
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Section Resources | ||
Section 10, Lecture 127 | ||
Angular Material Dialog Docs: https://material.angular.io/components/dialog/overview | ||
Resources for this lecture | ||
errors-01-added-dialog.zip | ||
errors-02-finished-main-implementation.zip | ||
errors-03-alternative-approach.zip | ||
Show more (1) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Section Resources | ||
Section 11, Lecture 138 | ||
More on Angular Modules: https://angular.io/guide/ngmodules | ||
Understanding Environment Variables: https://www.twilio.com/blog/2017/08/working-with-environment-variables-in-node-js.html | ||
Resources for this lecture | ||
optimizations-01-added-controllers-changed-middleware.zip | ||
optimizations-02-split-angular-into-modules.zip | ||
optimizations-03-finished.zip |
Binary file added
BIN
+301 KB
11. Optimizations/optimizations-01-added-controllers-changed-middleware.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Section Resources | ||
Section 12, Lecture 144 | ||
AWS Elastic Beanstalk Documentation: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html | ||
Resources for this lecture | ||
deployment-01-two-apps.zip | ||
deployment-02-one-app.zip |
Binary file not shown.
Binary file not shown.