Start Abschnitt 2

This commit is contained in:
francesco 2021-09-28 20:21:58 +02:00
parent ef75ffc72c
commit 7c1c0130a0
28 changed files with 12033 additions and 28346 deletions

View File

@ -24,4 +24,47 @@ Install nodejs, npm, angular-cli and @angular-devkit/build-angular
sudo apt install nodejs npm sudo apt install nodejs npm
sudo npm install -g @angular/cli sudo npm install -g @angular/cli
sudo npm install --save-dev @angular-devkit/build-angular sudo npm install --save-dev @angular-devkit/build-angular
``` ```
## Getting Started
Create first project
```bash
ng new my-first-app --no-strict
```
Select `N` for no routing and normal `CSS`.
Navigate to the project and spinn up the dev server
```bash
cd my-fisrt-app
gn serve
```
## NgTemplate
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.0.0.
### Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
### Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
### Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
### Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
### Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice.
### Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

View File

@ -1,6 +1,6 @@
# Project1 # MyFirstApp
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.5. This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.7.
## Development server ## Development server

View File

@ -3,7 +3,7 @@
"version": 1, "version": 1,
"newProjectRoot": "projects", "newProjectRoot": "projects",
"projects": { "projects": {
"project1": { "my-first-app": {
"projectType": "application", "projectType": "application",
"schematics": {}, "schematics": {},
"root": "", "root": "",
@ -13,7 +13,7 @@
"build": { "build": {
"builder": "@angular-devkit/build-angular:browser", "builder": "@angular-devkit/build-angular:browser",
"options": { "options": {
"outputPath": "dist/project1", "outputPath": "dist/my-first-app",
"index": "src/index.html", "index": "src/index.html",
"main": "src/main.ts", "main": "src/main.ts",
"polyfills": "src/polyfills.ts", "polyfills": "src/polyfills.ts",
@ -23,7 +23,6 @@
"src/assets" "src/assets"
], ],
"styles": [ "styles": [
"node_module/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css" "src/styles.css"
], ],
"scripts": [] "scripts": []
@ -65,10 +64,10 @@
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"configurations": { "configurations": {
"production": { "production": {
"browserTarget": "project1:build:production" "browserTarget": "my-first-app:build:production"
}, },
"development": { "development": {
"browserTarget": "project1:build:development" "browserTarget": "my-first-app:build:development"
} }
}, },
"defaultConfiguration": "development" "defaultConfiguration": "development"
@ -76,7 +75,7 @@
"extract-i18n": { "extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n", "builder": "@angular-devkit/build-angular:extract-i18n",
"options": { "options": {
"browserTarget": "project1:build" "browserTarget": "my-first-app:build"
} }
}, },
"test": { "test": {
@ -99,5 +98,5 @@
} }
} }
}, },
"defaultProject": "project1" "defaultProject": "my-first-app"
} }

View File

@ -25,7 +25,7 @@ module.exports = function (config) {
suppressAll: true // removes the duplicated traces suppressAll: true // removes the duplicated traces
}, },
coverageReporter: { coverageReporter: {
dir: require('path').join(__dirname, './coverage/project1'), dir: require('path').join(__dirname, './coverage/my-first-app'),
subdir: '.', subdir: '.',
reporters: [ reporters: [
{ type: 'html' }, { type: 'html' },

11973
my-first-app/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{ {
"name": "project1", "name": "my-first-app",
"version": "0.0.0", "version": "0.0.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
@ -23,8 +23,8 @@
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~12.2.5", "@angular-devkit/build-angular": "~12.2.7",
"@angular/cli": "~12.2.5", "@angular/cli": "~12.2.7",
"@angular/compiler-cli": "~12.2.0", "@angular/compiler-cli": "~12.2.0",
"@types/jasmine": "~3.8.0", "@types/jasmine": "~3.8.0",
"@types/node": "^12.11.1", "@types/node": "^12.11.1",

View File

@ -16,16 +16,16 @@ describe('AppComponent', () => {
expect(app).toBeTruthy(); expect(app).toBeTruthy();
}); });
it(`should have as title 'project1'`, () => { it(`should have as title 'my-first-app'`, () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance; const app = fixture.componentInstance;
expect(app.title).toEqual('project1'); expect(app.title).toEqual('my-first-app');
}); });
it('should render title', () => { it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges(); fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement; const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('project1 app is running!'); expect(compiled.querySelector('.content span')?.textContent).toContain('my-first-app app is running!');
}); });
}); });

View File

@ -6,5 +6,4 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.css'] styleUrls: ['./app.component.css']
}) })
export class AppComponent { export class AppComponent {
title = 'project1';
} }

View File

View File

Before

Width:  |  Height:  |  Size: 948 B

After

Width:  |  Height:  |  Size: 948 B

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Project1</title> <title>MyFirstApp</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">

28305
project1/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
<!-- saved from url=(0136)https://a.udemycdn.com/2019-08-23_05-33-38-2ef09f50675d6f46e53be04e6b97b2c8/original.html?nva=20200303175438&token=0771d733e4f2cc8c285b5 -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></head><body><div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</div>
<h2>Here are some links to help you start: </h2>
<ul>
<li>
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://angular.io/cli">CLI Documentation</a></h2>
</li>
<li>
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
</li>
</ul>
</body></html>