Skip to content

Commit 6d5bf48

Browse files
committed
After Module 3
1 parent 22c426b commit 6d5bf48

37 files changed

+799
-3
lines changed

APM-CLI-Final/.angular-cli.json

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

APM-CLI-Final/.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

APM-CLI-Final/.gitignore

Lines changed: 42 additions & 0 deletions
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

APM-CLI-Final/.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.autoSave": "afterDelay"
4+
}

APM-CLI-Final/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# APM
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.1.2.
4+
5+
## Development server
6+
7+
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.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.
12+
13+
## Build
14+
15+
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.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
Before running the tests make sure you are serving the app via `ng serve`.
25+
26+
## Further help
27+
28+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

APM-CLI-Final/e2e/app.e2e-spec.ts

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

APM-CLI-Final/e2e/app.po.ts

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

APM-CLI-Final/e2e/tsconfig.e2e.json

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

APM-CLI-Final/karma.conf.js

Lines changed: 33 additions & 0 deletions
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/0.13/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+
};

APM-CLI-Final/package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "apm",
3+
"version": "0.0.0",
4+
"license": "MIT",
5+
"scripts": {
6+
"ng": "ng",
7+
"start": "ng serve -o",
8+
"build": "ng build",
9+
"test": "ng test",
10+
"lint": "ng lint --type-check",
11+
"e2e": "ng e2e"
12+
},
13+
"private": true,
14+
"dependencies": {
15+
"@angular/animations": "^4.0.0",
16+
"@angular/common": "^4.0.0",
17+
"@angular/compiler": "^4.0.0",
18+
"@angular/core": "^4.0.0",
19+
"@angular/forms": "^4.0.0",
20+
"@angular/http": "^4.0.0",
21+
"@angular/platform-browser": "^4.0.0",
22+
"@angular/platform-browser-dynamic": "^4.0.0",
23+
"@angular/router": "^4.0.0",
24+
"bootstrap": "^3.3.7",
25+
"core-js": "^2.4.1",
26+
"rxjs": "^5.1.0",
27+
"zone.js": "^0.8.4"
28+
},
29+
"devDependencies": {
30+
"@angular/cli": "1.1.2",
31+
"@angular/compiler-cli": "^4.0.0",
32+
"@angular/language-service": "^4.0.0",
33+
"@types/jasmine": "2.5.45",
34+
"@types/node": "~6.0.60",
35+
"codelyzer": "~3.0.1",
36+
"jasmine-core": "~2.6.2",
37+
"jasmine-spec-reporter": "~4.1.0",
38+
"karma": "~1.7.0",
39+
"karma-chrome-launcher": "~2.1.1",
40+
"karma-cli": "~1.0.1",
41+
"karma-jasmine": "~1.1.0",
42+
"karma-jasmine-html-reporter": "^0.2.2",
43+
"karma-coverage-istanbul-reporter": "^1.2.1",
44+
"protractor": "~5.1.2",
45+
"ts-node": "~3.0.4",
46+
"tslint": "~5.3.2",
47+
"typescript": "~2.3.3"
48+
}
49+
}

APM-CLI-Final/protractor.conf.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Protractor configuration file, see link for more information
2+
// https://github.com/angular/protractor/blob/master/lib/config.ts
3+
4+
const { SpecReporter } = require('jasmine-spec-reporter');
5+
6+
exports.config = {
7+
allScriptsTimeout: 11000,
8+
specs: [
9+
'./e2e/**/*.e2e-spec.ts'
10+
],
11+
capabilities: {
12+
'browserName': 'chrome'
13+
},
14+
directConnect: true,
15+
baseUrl: 'http://localhost:4200/',
16+
framework: 'jasmine',
17+
jasmineNodeOpts: {
18+
showColors: true,
19+
defaultTimeoutInterval: 30000,
20+
print: function() {}
21+
},
22+
onPrepare() {
23+
require('ts-node').register({
24+
project: 'e2e/tsconfig.e2e.json'
25+
});
26+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27+
}
28+
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
"productId": 1,
4+
"productName": "Leaf Rake",
5+
"productCode": "GDN-0011",
6+
"releaseDate": "March 19, 2016",
7+
"description": "Leaf rake with 48-inch wooden handle.",
8+
"price": 19.95,
9+
"starRating": 3.2,
10+
"imageUrl": "http://openclipart.org/image/300px/svg_to_png/26215/Anonymous_Leaf_Rake.png"
11+
},
12+
{
13+
"productId": 2,
14+
"productName": "Garden Cart",
15+
"productCode": "GDN-0023",
16+
"releaseDate": "March 18, 2016",
17+
"description": "15 gallon capacity rolling garden cart",
18+
"price": 32.99,
19+
"starRating": 4.2,
20+
"imageUrl": "http://openclipart.org/image/300px/svg_to_png/58471/garden_cart.png"
21+
},
22+
{
23+
"productId": 5,
24+
"productName": "Hammer",
25+
"productCode": "TBX-0048",
26+
"releaseDate": "May 21, 2016",
27+
"description": "Curved claw steel hammer",
28+
"price": 8.9,
29+
"starRating": 4.8,
30+
"imageUrl": "http://openclipart.org/image/300px/svg_to_png/73/rejon_Hammer.png"
31+
},
32+
{
33+
"productId": 8,
34+
"productName": "Saw",
35+
"productCode": "TBX-0022",
36+
"releaseDate": "May 15, 2016",
37+
"description": "15-inch steel blade hand saw",
38+
"price": 11.55,
39+
"starRating": 3.7,
40+
"imageUrl": "http://openclipart.org/image/300px/svg_to_png/27070/egore911_saw.png"
41+
},
42+
{
43+
"productId": 10,
44+
"productName": "Video Game Controller",
45+
"productCode": "GMG-0042",
46+
"releaseDate": "October 15, 2015",
47+
"description": "Standard two-button video game controller",
48+
"price": 35.95,
49+
"starRating": 4.6,
50+
"imageUrl": "http://openclipart.org/image/300px/svg_to_png/120337/xbox-controller_01.png"
51+
}
52+
]

APM-CLI-Final/src/app/app.component.css

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--The whole content below can be removed with the new code.-->
2+
<div style="text-align:center">
3+
<h1>
4+
TaDa! Welcome to {{title}}!!
5+
</h1>
6+
... Starter Files ...
7+
</div>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { TestBed, async } from '@angular/core/testing';
2+
3+
import { AppComponent } from './app.component';
4+
5+
describe('AppComponent', () => {
6+
beforeEach(async(() => {
7+
TestBed.configureTestingModule({
8+
declarations: [
9+
AppComponent
10+
],
11+
}).compileComponents();
12+
}));
13+
14+
it('should create the app', async(() => {
15+
const fixture = TestBed.createComponent(AppComponent);
16+
const app = fixture.debugElement.componentInstance;
17+
expect(app).toBeTruthy();
18+
}));
19+
20+
it(`should have as title 'Angular: Getting Started'`, async(() => {
21+
const fixture = TestBed.createComponent(AppComponent);
22+
const app = fixture.debugElement.componentInstance;
23+
expect(app.title).toEqual('Angular: Getting Started');
24+
}));
25+
26+
it('should render title in a h1 tag', async(() => {
27+
const fixture = TestBed.createComponent(AppComponent);
28+
fixture.detectChanges();
29+
const compiled = fixture.debugElement.nativeElement;
30+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to Angular: Getting Started!!');
31+
}));
32+
});

0 commit comments

Comments
 (0)