From b3abef57d50c8747ba29262b5af89b1c0523d6e1 Mon Sep 17 00:00:00 2001 From: Alexander Schneider <alexander.schneider@th-nuernberg.de> Date: Wed, 19 Sep 2018 11:58:45 +0200 Subject: [PATCH] new stuff --- .angular-cli.json | 20 ++++++++++ package.json | 51 +++++++++++++++++++++++ src/app/app.component.css | 3 ++ src/app/app.component.html | 7 ++++ src/app/app.component.ts | 10 +++++ src/app/app.module.ts | 12 ++++++ src/environments/environment.prod.ts | 3 ++ src/environments/environment.ts | 8 ++++ src/index.html | 17 ++++++++ src/main.ts | 13 ++++++ src/polyfills.ts | 60 ++++++++++++++++++++++++++++ src/styles.css | 6 +++ src/typings.d.ts | 5 +++ 13 files changed, 215 insertions(+) create mode 100644 .angular-cli.json create mode 100644 package.json create mode 100644 src/app/app.component.css create mode 100644 src/app/app.component.html create mode 100644 src/app/app.component.ts create mode 100644 src/app/app.module.ts create mode 100644 src/environments/environment.prod.ts create mode 100644 src/environments/environment.ts create mode 100644 src/index.html create mode 100644 src/main.ts create mode 100644 src/polyfills.ts create mode 100644 src/styles.css create mode 100644 src/typings.d.ts diff --git a/.angular-cli.json b/.angular-cli.json new file mode 100644 index 0000000..a83740e --- /dev/null +++ b/.angular-cli.json @@ -0,0 +1,20 @@ +{ + "apps": [ + { + "root": "src", + "outDir": "dist", + "assets": ["assets", "favicon.ico"], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "prefix": "app", + "styles": ["styles.css"], + "scripts": [], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5d53c7f --- /dev/null +++ b/package.json @@ -0,0 +1,51 @@ +{ + "name": "angular", + "version": "0.0.0", + "license": "MIT", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build --prod", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "^5.2.0", + "@angular/common": "^5.2.0", + "@angular/compiler": "^5.2.0", + "@angular/core": "^5.2.0", + "@angular/forms": "^5.2.0", + "@angular/http": "^5.2.0", + "@angular/platform-browser": "^5.2.0", + "@angular/platform-browser-dynamic": "^5.2.0", + "@angular/router": "^5.2.0", + "core-js": "^2.4.1", + "rxjs": "^5.5.6", + "zone.js": "^0.8.19" + }, + "devDependencies": { + "@angular/cli": "1.6.6", + "@angular/compiler-cli": "^5.2.0", + "@angular/language-service": "^5.2.0", + "@types/core-js": "0.9.46", + "@types/jasmine": "~2.8.3", + "@types/jasminewd2": "~2.0.2", + "@types/node": "~6.0.60", + "codelyzer": "^4.0.1", + "jasmine-core": "~2.8.0", + "jasmine-spec-reporter": "~4.2.1", + "karma": "~2.0.0", + "karma-chrome-launcher": "~2.2.0", + "karma-coverage-istanbul-reporter": "^1.2.1", + "karma-jasmine": "~1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.1.2", + "ts-node": "~4.1.0", + "tslint": "~5.9.1", + "typescript": "~2.5.3" + }, + "keywords": ["angular"], + "description": "" +} diff --git a/src/app/app.component.css b/src/app/app.component.css new file mode 100644 index 0000000..87da7e8 --- /dev/null +++ b/src/app/app.component.css @@ -0,0 +1,3 @@ +ul { + text-align: center; +} diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000..a37a97c --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1,7 @@ +<!--The content below is only a placeholder and can be replaced.--> +<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> diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 0000000..0dadf8e --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,10 @@ +import { Component } from "@angular/core"; + +@Component({ + selector: "app-root", + templateUrl: "./app.component.html", + styleUrls: ["./app.component.css"] +}) +export class AppComponent { + title = "CodeSandbox"; +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..c7460cd --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,12 @@ +import { BrowserModule } from "@angular/platform-browser"; +import { NgModule } from "@angular/core"; + +import { AppComponent } from "./app.component"; + +@NgModule({ + declarations: [AppComponent], + imports: [BrowserModule], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule {} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..b7f639a --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,8 @@ +// The file contents for the current environment will overwrite these during build. +// The build system defaults to the dev environment which uses `environment.ts`, but if you do +// `ng build --env=prod` then `environment.prod.ts` will be used instead. +// The list of which env maps to which file can be found in `.angular-cli.json`. + +export const environment = { + production: false +}; diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..dfd3201 --- /dev/null +++ b/src/index.html @@ -0,0 +1,17 @@ +<!doctype html> +<html lang="en"> + +<head> + <meta charset="utf-8"> + <title>Angular</title> + <base href="/"> + + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="icon" type="image/x-icon" href="favicon.ico"> +</head> + +<body> + <app-root></app-root> +</body> + +</html> \ No newline at end of file diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..bf94674 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,13 @@ +import { enableProdMode } from "@angular/core"; +import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; + +import { AppModule } from "./app/app.module"; +import { environment } from "./environments/environment"; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch(err => console.log(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 0000000..9e81a1d --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,60 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import 'core-js/es6/reflect'; + +/** Evergreen browsers require these. **/ +// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. +import "core-js/es7/reflect"; + +/** + * Required to support Web Animations `@angular/platform-browser/animations`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import "zone.js/dist/zone"; // Included with Angular CLI. + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/src/styles.css b/src/styles.css new file mode 100644 index 0000000..37408d1 --- /dev/null +++ b/src/styles.css @@ -0,0 +1,6 @@ +/* You can add global styles to this file, and also import other style files */ + +html, +body { + font-family: sans-serif; +} diff --git a/src/typings.d.ts b/src/typings.d.ts new file mode 100644 index 0000000..ef5c7bd --- /dev/null +++ b/src/typings.d.ts @@ -0,0 +1,5 @@ +/* SystemJS module definition */ +declare var module: NodeModule; +interface NodeModule { + id: string; +} -- GitLab