Repository: angular-university/angular-course
Branch: master
Commit: 8ef2f749e26d
Files: 59
Total size: 50.8 KB
Directory structure:
gitextract_qso4u9bd/
├── .browserslistrc
├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── angular.json
├── e2e/
│ ├── protractor.conf.js
│ ├── src/
│ │ ├── app.e2e-spec.ts
│ │ └── app.po.ts
│ └── tsconfig.e2e.json
├── package.json
├── proxy.json
├── server/
│ ├── get-courses.route.ts
│ └── save-course.route.ts
├── server.ts
├── server.tsconfig.json
├── src/
│ ├── app/
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── config.ts
│ │ ├── course-title/
│ │ │ ├── course-title.component.css
│ │ │ ├── course-title.component.html
│ │ │ ├── course-title.component.spec.ts
│ │ │ └── course-title.component.ts
│ │ ├── courses/
│ │ │ ├── course-card/
│ │ │ │ ├── course-card.component.css
│ │ │ │ ├── course-card.component.html
│ │ │ │ ├── course-card.component.spec.ts
│ │ │ │ └── course-card.component.ts
│ │ │ ├── course-image/
│ │ │ │ ├── course-image.component.css
│ │ │ │ ├── course-image.component.html
│ │ │ │ ├── course-image.component.spec.ts
│ │ │ │ └── course-image.component.ts
│ │ │ ├── courses.module.spec.ts
│ │ │ ├── courses.service.ts
│ │ │ ├── directives/
│ │ │ │ ├── highlighted.directive.spec.ts
│ │ │ │ ├── highlighted.directive.ts
│ │ │ │ ├── ngx-unless.directive.spec.ts
│ │ │ │ └── ngx-unless.directive.ts
│ │ │ └── filter-by-category.pipe.ts
│ │ └── model/
│ │ └── course.ts
│ ├── assets/
│ │ ├── .gitkeep
│ │ └── styles.css
│ ├── db-data.ts
│ ├── environments/
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── index.html
│ ├── karma.conf.js
│ ├── locale/
│ │ └── messages.fr.xlf
│ ├── main.ts
│ ├── messages.xlf
│ ├── polyfills.ts
│ ├── styles.css
│ ├── test.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── tsconfig.json
└── tslint.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .browserslistrc
================================================
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For IE 9-11 support, please uncomment the last line of the file and adjust as needed
> 0.5%
last 2 versions
Firefox ESR
not dead
# IE 9-11
================================================
FILE: .editorconfig
================================================
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
================================================
FILE: .gitignore
================================================
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Angular University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
## Angular Core Deep Dive (Video Course)
This repository contains the code of the [Angular Core Deep Dive](https://angular-university.io/course/angular-course).
This course repository is updated to Angular 21:

# Installation pre-requisites
IMPORTANT: Please use Node 22 LTS (Long Term Support version).
# Installing the Angular CLI
With the following command the angular-cli will be installed globally in your machine:
npm install -g @angular/cli
# How To install this repository
We can install the master branch using the following commands:
git clone https://github.com/angular-university/angular-course.git
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:
cd angular-course
npm install
Its also possible to install the modules as usual using npm:
npm install
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.
This should take a couple of minutes. If there are issues, please post the complete error message in the Questions section of the course.
# To Run the Development Backend Server
In order to be able to provide realistic examples, we will need in our playground a small REST API backend server. We can start the sample application backend with the following command:
npm run server
This is a small Node REST API server.
# To run the Development UI Server
To run the frontend part of our code, we will use the Angular CLI:
npm start
The application is visible at port 4200: [http://localhost:4200](http://localhost:4200)
# Important
This repository has multiple branches, have a look at the beginning of each section to see the name of the branch.
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:
git branch -a
The remote branches have their starting in origin, such as for example 1-navigation-and-containers.
We can checkout the remote branch and start tracking it with a local branch that has the same name, by using the following command:
git checkout -b section-1 origin/1-navigation-and-containers
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.
# Other Courses
# Modern Angular With Signals
If you are looking for the [Modern Angular With Signals Course](https://angular-university.io/course/angular-signals-course), the repo with the full code can be found here:

# RxJs In Practice Course
If you are looking for the [RxJs In Practice Course](https://angular-university.io/course/rxjs-course), the repo with the full code can be found here:

# NgRx In Depth Course
If you are looking for the [NgRx In Depth Course](https://angular-university.io/course/angular-ngrx-course), the repo with the full code can be found here:

# Angular PWA Course
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:

# Angular Security Masterclass
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:
[Angular Security Masterclass](https://github.com/angular-university/angular-security-course).

# Angular Advanced Library Laboratory Course
If you are looking for the Angular Advanced Course, the repo with the full code can be found here:
[Angular Advanced Library Laboratory Course: Build Your Own Library](https://angular-university.io/course/angular-advanced-course).

## RxJs and Reactive Patterns Angular Architecture Course
If you are looking for the RxJs and Reactive Patterns Angular Architecture Course code, the repo with the full code can be found here:
[RxJs and Reactive Patterns Angular Architecture Course](https://angular-university.io/course/reactive-angular-architecture-course)

## Angular Ngrx Reactive Extensions Architecture Course
If you are looking for the Angular Ngrx Reactive Extensions Architecture Course code, the repo with the full code can be found here:
[Angular Ngrx Reactive Extensions Architecture Course](https://angular-university.io/course/angular2-ngrx)
[Github repo for this course](https://github.com/angular-university/ngrx-course)

## Angular 2 and Firebase - Build a Web Application Course
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:
[Angular 2 and Firebase - Build a Web Application](https://angular-university.io/course/build-an-application-with-angular2)
[Github repo for this course](https://github.com/angular-university/angular-firebase-app)

## Complete Typescript 2 Course - Build A REST API
If you are looking for the Complete Typescript 2 Course - Build a REST API, the repo with the full code can be found here:
[https://angular-university.io/course/typescript-2-tutorial](https://github.com/angular-university/complete-typescript-course)
[Github repo for this course](https://github.com/angular-university/complete-typescript-course)

================================================
FILE: angular.json
================================================
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-course": {
"i18n": {
"locales": {
"fr": {
"translation": "src/locale/messages.fr.xlf",
"baseHref": ""
}
}
},
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": {
"base": "dist/angular-course"
},
"index": "src/index.html",
"polyfills": [
"src/polyfills.ts"
],
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
{
"input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"inject": true
},
"src/styles.css"
],
"scripts": [
{
"input": "node_modules/document-register-element/build/document-register-element.js",
"inject": true
}
],
"extractLicenses": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true,
"browser": "src/main.ts"
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true
},
"fr": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"outputPath": {
"base": "dist/angular-course-fr/"
},
"i18nFile": "src/locale/messages.fr.xlf",
"i18nLocale": "fr",
"i18nMissingTranslation": "ignore"
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"buildTarget": "angular-course:build"
},
"configurations": {
"production": {
"buildTarget": "angular-course:build:production"
},
"fr": {
"buildTarget": "angular-course:build:fr"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "angular-course:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
{
"input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"inject": true
},
"src/styles.css"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
}
}
},
"angular-course-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "angular-course:serve"
},
"configurations": {
"production": {
"devServerTarget": "angular-course:serve:production"
}
}
}
}
}
},
"cli": {
"analytics": "e878a578-eb4f-4c7c-bbaf-6f0c4ac42135"
},
"schematics": {
"@schematics/angular:component": {
"type": "component"
},
"@schematics/angular:directive": {
"type": "directive"
},
"@schematics/angular:service": {
"type": "service"
},
"@schematics/angular:guard": {
"typeSeparator": "."
},
"@schematics/angular:interceptor": {
"typeSeparator": "."
},
"@schematics/angular:module": {
"typeSeparator": "."
},
"@schematics/angular:pipe": {
"typeSeparator": "."
},
"@schematics/angular:resolver": {
"typeSeparator": "."
}
}
}
================================================
FILE: e2e/protractor.conf.js
================================================
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
================================================
FILE: e2e/src/app.e2e-spec.ts
================================================
import { AppPage } from './app.po';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to angular-course!');
});
});
================================================
FILE: e2e/src/app.po.ts
================================================
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
================================================
FILE: e2e/tsconfig.e2e.json
================================================
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
================================================
FILE: package.json
================================================
{
"name": "angular-course",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config ./proxy.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"server": "ts-node -P ./server.tsconfig.json ./server.ts"
},
"private": true,
"dependencies": {
"@angular/animations": "^21.0.1",
"@angular/cdk": "^21.0.1",
"@angular/common": "^21.0.1",
"@angular/compiler": "^21.0.1",
"@angular/core": "^21.0.1",
"@angular/elements": "^21.0.1",
"@angular/forms": "^21.0.1",
"@angular/localize": "^21.0.1",
"@angular/material": "^21.0.1",
"@angular/platform-browser": "^21.0.1",
"@angular/platform-browser-dynamic": "^21.0.1",
"@angular/router": "^21.0.1",
"body-parser": "^1.18.3",
"core-js": "^2.5.4",
"cors": "^2.8.5",
"document-register-element": "1.8.1",
"express": "^4.16.3",
"rxjs": "^6.5.4",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^21.0.1",
"@angular/cli": "^21.0.1",
"@angular/compiler-cli": "^21.0.1",
"@angular/language-service": "^21.0.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.7.0",
"ts-node": "~5.0.1",
"tslint": "~6.1.0",
"typescript": "~5.9.3"
}
}
================================================
FILE: proxy.json
================================================
{
"/api": {
"target": "http://localhost:9000",
"secure": false
}
}
================================================
FILE: server/get-courses.route.ts
================================================
import {Request, Response} from 'express';
import {COURSES} from '../src/db-data';
export function getAllCourses(req: Request, res: Response) {
res.status(200).json(Object.values(COURSES));
}
export function getCourseById(req: Request, res: Response) {
const courseId = req.params['id'];
const courses: any = Object.values(COURSES);
const course = courses.find(course => course.id == courseId);
res.status(200).json(course);
}
================================================
FILE: server/save-course.route.ts
================================================
import {Request, Response} from 'express';
import {findCourseById} from '../src/db-data';
export function saveCourse(req: Request, res: Response) {
const id = req.params["id"],
changes = req.body;
console.log("Saving course", id, JSON.stringify(changes));
const course = findCourseById(id);
course.description = changes.description;
res.status(200).json(course);
}
================================================
FILE: server.ts
================================================
import * as express from 'express';
import {Application} from "express";
import {getAllCourses} from './server/get-courses.route';
import {saveCourse} from './server/save-course.route';
const cors = require('cors');
const bodyParser = require('body-parser');
const app: Application = express();
app.use(cors({origin: true}));
app.use(bodyParser.json());
app.route('/api/courses').get(getAllCourses);
app.route('/api/courses/:id').put(saveCourse);
const httpServer = app.listen(9000, () => {
console.log("HTTP REST API Server running at http://localhost:" + httpServer.address().port);
});
================================================
FILE: server.tsconfig.json
================================================
{
"compilerOptions": {
"module": "commonjs"
}
}
================================================
FILE: src/app/app.component.css
================================================
.top-menu {
background: #1976d2;
padding: 2px 15px;
}
.logo {
max-height: 55px;
}
.courses {
max-width: 400px;
margin: 50px auto;
}
================================================
FILE: src/app/app.component.html
================================================