Skip to content

Commit b1cc120

Browse files
committed
Angular Universal Course
0 parents  commit b1cc120

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+15011
-0
lines changed

.angular-cli.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "angular-universal-course"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"test": "test.ts",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
20+
"prefix": "",
21+
"styles": [
22+
"styles.scss"
23+
],
24+
"scripts": [],
25+
"environmentSource": "environments/environment.ts",
26+
"environments": {
27+
"dev": "environments/environment.ts",
28+
"prod": "environments/environment.prod.ts"
29+
}
30+
}
31+
],
32+
"e2e": {
33+
"protractor": {
34+
"config": "./protractor.conf.js"
35+
}
36+
},
37+
"lint": [
38+
{
39+
"project": "src/tsconfig.app.json",
40+
"exclude": "**/node_modules/**"
41+
},
42+
{
43+
"project": "src/tsconfig.spec.json",
44+
"exclude": "**/node_modules/**"
45+
},
46+
{
47+
"project": "e2e/tsconfig.e2e.json",
48+
"exclude": "**/node_modules/**"
49+
}
50+
],
51+
"test": {
52+
"karma": {
53+
"config": "./karma.conf.js"
54+
}
55+
},
56+
"defaults": {
57+
"styleExt": "scss",
58+
"component": {}
59+
}
60+
}

.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
testem.log
34+
/typings
35+
36+
# e2e
37+
/e2e/*.js
38+
/e2e/*.map
39+
40+
# System Files
41+
.DS_Store
42+
Thumbs.db

INIT.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
# Initializing a clean Angular Material Project
3+
4+
These are the commands and steps needed to scaffold a new Angular Material project from scratch,
5+
from an empty folder.
6+
7+
Please make sure to have the latest CLI, and at least NPM 5.
8+
9+
When is doubt, its recommended to update to the latest version of node using a node versioning tool
10+
such as for example [nave](https://github.com/isaacs/nave) or [nvm-windows](https://github.com/coreybutler/nvm-windows).
11+
12+
# Step 1 - Scaffold a clean project using the Angular CLI
13+
14+
With a CLI version 1.5 or above, let's scaffold a new project with routing:
15+
16+
ng new angular-material-hello-world --routing
17+
18+
# Step 2 - Installing Angular Material dependencies
19+
20+
Next, let's install these dependencies:
21+
22+
npm install @angular/material @angular/cdk @angular/animations hammerjs
23+
24+
# Step 3 - Adding Google Material Icons Font
25+
26+
Let's add this to our index.html:
27+
28+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
29+
30+
# Step 4 - choosing a Theme
31+
32+
Before starting to import components, let's choose a widget theme, have a look at the themes available
33+
34+
inside `node_modules/@angular/material/prebuild-themes`.
35+
36+
We can for example use the Indigo Pink theme by adding this line to our styles.css file:
37+
38+
@import "~@angular/material/prebuilt-themes/indigo-pink.css";

README.md

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
2+
## Angular Universal Course
3+
4+
This repository contains the code of the [Angular Universal Course](https://angular-university.io/course/angular-universal-course).
5+
6+
This course repository is updated to Angular v5, and there is a package-lock.json file available, for avoiding semantic versioning installation issues.
7+
8+
![Angular Universal Course](https://angular-academy.s3.amazonaws.com/thumbnails/angular_universal.jpg)
9+
10+
11+
# Installation pre-requisites
12+
13+
IMPORTANT: Please use NPM 5 or above, to make sure the package-lock.json is used.
14+
15+
For running this project we need and npm installed on our machine. These are some tutorials to install node in different operating systems:
16+
17+
*Its important to install the latest version of Node*
18+
19+
- [Install Node and NPM on Windows](https://www.youtube.com/watch?v=8ODS6RM6x7g)
20+
- [Install Node and NPM on Linux](https://www.youtube.com/watch?v=yUdHk-Dk_BY)
21+
- [Install Node and NPM on Mac](https://www.youtube.com/watch?v=Imj8PgG3bZU)
22+
23+
24+
# Installing the Angular CLI
25+
26+
With the following command the angular-cli will be installed globally in your machine:
27+
28+
npm install -g @angular/cli
29+
30+
31+
# How To install this repository
32+
33+
We can install the master branch using the following commands:
34+
35+
git clone https://github.com/angular-university/angular-universal-course.git
36+
37+
This repository is made of several separate npm modules, that are installable separately. For example, to run the au-input module, we can do the following:
38+
39+
cd angular-universal-course
40+
npm install
41+
42+
Its also possible to install the modules as usual using npm:
43+
44+
npm install
45+
46+
NPM 5 or above has the big advantage that if you use it you will be installing the exact same dependencies than I installed in my machine, so you wont run into issues caused by semantic versioning updates.
47+
48+
This should take a couple of minutes. If there are issues, please post the complete error message in the Questions section of the course.
49+
50+
# To Run the Development Backend Server
51+
52+
We can start the sample application backend with the following command:
53+
54+
npm run server
55+
56+
This is a small Node REST API server.
57+
58+
# To run the Development UI Server
59+
60+
To run the frontend part of our code, we will use the Angular CLI:
61+
62+
npm start
63+
64+
The application is visible at port 4200, but you need to use HTTPS - [https://localhost:4200](https://localhost:4200)
65+
66+
This application uses a self-signed certificate, so you will need to accept it using the browser. If you are using Chrome, you will need to click Advanced and then choose "Proceed to localhost".
67+
68+
# Important
69+
70+
This repository has multiple branches, have a look at the beginning of each section to see the name of the branch.
71+
72+
At certain points along the course, you will be asked to checkout other remote branches other than master. You can view all branches that you have available remotely using the following command:
73+
74+
git branch -a
75+
76+
The remote branches have their starting in origin, such as for example section-1.
77+
78+
We can checkout the remote branch and start tracking it with a local branch that has the same name, by using the following command:
79+
80+
git checkout -b section-1 origin/section-1
81+
82+
It's also possible to download a ZIP file for a given branch, using the branch dropdown on this page on the top left, and then selecting the Clone or Download / Download as ZIP button.
83+
84+
# Other Courses
85+
86+
# Angular PWA Course
87+
88+
If you are looking for the [Angular PWA Course](https://angular-university.io/course/angular-pwa-course), the repo with the full code can be found here:
89+
90+
![Angular PWA Course - Build the future of the Web Today](https://s3-us-west-1.amazonaws.com/angular-university/course-images/angular-pwa-course.png)
91+
92+
# Angular Security Masterclass
93+
94+
If you are looking for the [Angular Security Masterclass](https://angular-university.io/course/angular-security-course), the repo with the full code can be found here:
95+
96+
[Angular Security Masterclass](https://github.com/angular-university/angular-security-course).
97+
98+
![Angular Security Masterclass](https://s3-us-west-1.amazonaws.com/angular-university/course-images/security-cover-small-v2.png)
99+
100+
101+
102+
# Angular Advanced Library Laboratory Course
103+
104+
If you are looking for the Angular Advanced Course, the repo with the full code can be found here:
105+
106+
[Angular Advanced Library Laboratory Course: Build Your Own Library](https://angular-university.io/course/angular-advanced-course).
107+
108+
![Angular Advanced Library Laboratory Course: Build Your Own Library](https://angular-academy.s3.amazonaws.com/thumbnails/advanced_angular-small-v3.png)
109+
110+
111+
## RxJs and Reactive Patterns Angular Architecture Course
112+
113+
If you are looking for the RxJs and Reactive Patterns Angular Architecture Course code, the repo with the full code can be found here:
114+
115+
[RxJs and Reactive Patterns Angular Architecture Course](https://angular-university.io/course/reactive-angular-architecture-course)
116+
117+
![RxJs and Reactive Patterns Angular Architecture Course](https://s3-us-west-1.amazonaws.com/angular-academy/blog/images/rxjs-reactive-patterns-small.png)
118+
119+
120+
121+
## Angular Ngrx Reactive Extensions Architecture Course
122+
123+
If you are looking for the Angular Ngrx Reactive Extensions Architecture Course code, the repo with the full code can be found here:
124+
125+
[Angular Ngrx Reactive Extensions Architecture Course](https://angular-university.io/course/angular2-ngrx)
126+
127+
[Github repo for this course](https://github.com/angular-university/ngrx-course)
128+
129+
![Angular Ngrx Course](https://angular-academy.s3.amazonaws.com/thumbnails/ngrx-angular.png)
130+
131+
132+
133+
## Angular 2 and Firebase - Build a Web Application Course
134+
135+
If you are looking for the Angular 2 and Firebase - Build a Web Application Course code, the repo with the full code can be found here:
136+
137+
[Angular 2 and Firebase - Build a Web Application](https://angular-university.io/course/build-an-application-with-angular2)
138+
139+
[Github repo for this course](https://github.com/angular-university/angular-firebase-app)
140+
141+
![Angular firebase course](https://angular-academy.s3.amazonaws.com/thumbnails/angular_app-firebase-small.jpg)
142+
143+
144+
## Complete Typescript 2 Course - Build A REST API
145+
146+
If you are looking for the Complete Typescript 2 Course - Build a REST API, the repo with the full code can be found here:
147+
148+
[https://angular-university.io/course/typescript-2-tutorial](https://github.com/angular-university/complete-typescript-course)
149+
150+
[Github repo for this course](https://github.com/angular-university/complete-typescript-course)
151+
152+
![Complete Typescript Course](https://angular-academy.s3.amazonaws.com/thumbnails/typescript-2-small.png)
153+

e2e/app.e2e-spec.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { AppPage } from './app.po';
2+
3+
describe('angular-universal-course App', () => {
4+
let page: AppPage;
5+
6+
beforeEach(() => {
7+
page = new AppPage();
8+
});
9+
10+
it('should display welcome message', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('Welcome to app!');
13+
});
14+
});

e2e/app.po.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('app-root h1')).getText();
10+
}
11+
}

e2e/tsconfig.e2e.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"baseUrl": "./",
6+
"module": "commonjs",
7+
"target": "es5",
8+
"types": [
9+
"jasmine",
10+
"jasminewd2",
11+
"node"
12+
]
13+
}
14+
}

karma.conf.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular/cli'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular/cli/plugins/karma')
14+
],
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
reports: [ 'html', 'lcovonly' ],
20+
fixWebpackSourcePaths: true
21+
},
22+
angularCli: {
23+
environment: 'dev'
24+
},
25+
reporters: ['progress', 'kjhtml'],
26+
port: 9876,
27+
colors: true,
28+
logLevel: config.LOG_INFO,
29+
autoWatch: true,
30+
browsers: ['Chrome'],
31+
singleRun: false
32+
});
33+
};

0 commit comments

Comments
 (0)