-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 6d80e31
Showing
18 changed files
with
338 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,3 @@ | ||
# angular-86zqrg | ||
|
||
[Edit on StackBlitz ⚡️](https://stackblitz.com/edit/angular-86zqrg) |
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,100 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"demo": { | ||
"root": "", | ||
"sourceRoot": "src", | ||
"projectType": "application", | ||
"prefix": "app", | ||
"schematics": {}, | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:browser", | ||
"options": { | ||
"outputPath": "dist/demo", | ||
"index": "src/index.html", | ||
"main": "src/main.ts", | ||
"polyfills": "src/polyfills.ts", | ||
"tsConfig": "src/tsconfig.app.json", | ||
"assets": [ | ||
"src/favicon.ico", | ||
"src/assets" | ||
], | ||
"styles": [ | ||
"src/styles.css" | ||
], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"fileReplacements": [ | ||
{ | ||
"replace": "src/environments/environment.ts", | ||
"with": "src/environments/environment.prod.ts" | ||
} | ||
], | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"extractCss": true, | ||
"namedChunks": false, | ||
"aot": true, | ||
"extractLicenses": true, | ||
"vendorChunk": false, | ||
"buildOptimizer": true | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"options": { | ||
"browserTarget": "demo:build" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "demo:build:production" | ||
} | ||
} | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"browserTarget": "demo: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": [ | ||
"styles.css" | ||
], | ||
"scripts": [], | ||
"assets": [ | ||
"src/favicon.ico", | ||
"src/assets" | ||
] | ||
} | ||
}, | ||
"lint": { | ||
"builder": "@angular-devkit/build-angular:tslint", | ||
"options": { | ||
"tsConfig": [ | ||
"src/tsconfig.app.json", | ||
"src/tsconfig.spec.json" | ||
], | ||
"exclude": [ | ||
"**/node_modules/**" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"defaultProject": "demo" | ||
} |
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,46 @@ | ||
{ | ||
"name": "angular", | ||
"version": "0.0.0", | ||
"private": true, | ||
"dependencies": { | ||
"@angular/common": "^8.0.0", | ||
"@angular/compiler": "^8.0.0", | ||
"@angular/core": "^8.0.0", | ||
"@angular/forms": "^8.0.0", | ||
"@angular/platform-browser": "^8.0.0", | ||
"@angular/platform-browser-dynamic": "^8.0.0", | ||
"@angular/router": "^8.0.0", | ||
"core-js": "2", | ||
"rxjs": "^6.5.2", | ||
"zone.js": "^0.9.1" | ||
}, | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng build", | ||
"test": "ng test", | ||
"lint": "ng lint", | ||
"e2e": "ng e2e" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "~0.10.0", | ||
"@angular/cli": "~7.0.2", | ||
"@angular/compiler-cli": "~7.0.0", | ||
"@angular/language-service": "~7.0.0", | ||
"@types/node": "~8.9.4", | ||
"@types/jasmine": "~2.8.8", | ||
"@types/jasminewd2": "~2.0.3", | ||
"codelyzer": "~4.5.0", | ||
"jasmine-core": "~2.99.1", | ||
"jasmine-spec-reporter": "~4.2.1", | ||
"karma": "~3.0.0", | ||
"karma-chrome-launcher": "~2.2.0", | ||
"karma-coverage-istanbul-reporter": "~2.0.1", | ||
"karma-jasmine": "~1.1.2", | ||
"karma-jasmine-html-reporter": "^0.2.2", | ||
"protractor": "~5.4.0", | ||
"ts-node": "~7.0.0", | ||
"tslint": "~5.11.0", | ||
"typescript": "~3.1.1" | ||
} | ||
} |
Empty file.
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,12 @@ | ||
export const brands = [ | ||
{ | ||
name: 'Pepsi', | ||
logo: '', | ||
description: 'A large phone with one of the best screens' | ||
}, | ||
{ | ||
name: 'Coke', | ||
logo: '', | ||
description: 'A great phone with one of the best cameras' | ||
} | ||
]; |
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,3 @@ | ||
p { | ||
font-family: Lato; | ||
} |
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 @@ | ||
<hello name="{{ name }}"></hello> | ||
<p> | ||
Start editing to see some magic happen :) | ||
</p> | ||
<app-shopping></app-shopping> |
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,10 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
templateUrl: './app.component.html', | ||
styleUrls: [ './app.component.css' ] | ||
}) | ||
export class AppComponent { | ||
name = 'Angular'; | ||
} |
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,18 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { HttpClientModule } from '@angular/common/http'; | ||
|
||
import { AppComponent } from './app.component'; | ||
import { HelloComponent } from './hello.component'; | ||
|
||
import { DeviceService } from './device.service'; | ||
import { ShoppingComponent } from './shopping/shopping.component'; | ||
|
||
@NgModule({ | ||
imports: [ BrowserModule, FormsModule, HttpClientModule ], | ||
declarations: [ AppComponent, HelloComponent, ShoppingComponent], | ||
bootstrap: [ AppComponent ], | ||
providers: [DeviceService] | ||
}) | ||
export class AppModule { } |
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,4 @@ | ||
{ | ||
"heroesUrl": "api/heroes", | ||
"textfile": "assets/textfile.txt" | ||
} |
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,21 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
|
||
@Injectable() | ||
export class DeviceService { | ||
|
||
constructor(private http: HttpClient) { } | ||
configUrl = 'assets/config.json'; | ||
|
||
getDevices() { | ||
return this.http.get(this.configUrl); | ||
} | ||
|
||
addDevices (device): Observable { | ||
return this.http.post(this.url, device, httpOptions) | ||
.pipe( | ||
catchError(this.handleError('', hero)) | ||
); | ||
} | ||
|
||
} |
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,10 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'hello', | ||
template: `<h1>Hello {{name}}!</h1>`, | ||
styles: [`h1 { font-family: Lato; }`] | ||
}) | ||
export class HelloComponent { | ||
@Input() name: string; | ||
} |
Empty file.
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 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import {brands} from '../Brands'; | ||
|
||
@Component({ | ||
selector: 'app-shopping', | ||
templateUrl: './shopping.component.html', | ||
styleUrls: ['./shopping.component.css'] | ||
}) | ||
export class ShoppingComponent implements OnInit { | ||
brands = brands; | ||
constructor() { } | ||
|
||
ngOnInit() { | ||
|
||
} | ||
|
||
} |
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 @@ | ||
<my-app>loading</my-app> |
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,16 @@ | ||
import './polyfills'; | ||
|
||
import { enableProdMode } from '@angular/core'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { AppModule } from './app/app.module'; | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule).then(ref => { | ||
// Ensure Angular destroys itself on hot reloads. | ||
if (window['ngRef']) { | ||
window['ngRef'].destroy(); | ||
} | ||
window['ngRef'] = ref; | ||
|
||
// Otherwise, log the boot error | ||
}).catch(err => console.error(err)); |
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,71 @@ | ||
/** | ||
* 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/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 to support `@angular/animation`. */ | ||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`. | ||
|
||
|
||
/** Evergreen browsers require these. **/ | ||
// import 'core-js/es6/reflect'; | ||
// import 'core-js/es7/reflect'; | ||
|
||
|
||
/** | ||
* Web Animations `@angular/platform-browser/animations` | ||
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. | ||
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). | ||
*/ | ||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`. | ||
|
||
|
||
|
||
/*************************************************************************************************** | ||
* Zone JS is required by Angular itself. | ||
*/ | ||
import 'zone.js/dist/zone'; // Included with Angular CLI. | ||
|
||
|
||
/*************************************************************************************************** | ||
* APPLICATION IMPORTS | ||
*/ | ||
|
||
/** | ||
* Date, currency, decimal and percent pipes. | ||
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 | ||
*/ | ||
// import 'intl'; // Run `npm install --save intl`. |
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 @@ | ||
/* Add application styles & imports to this file! */ |