Skip to content

Commit 7e8c482

Browse files
committed
Project init
0 parents  commit 7e8c482

30 files changed

+701
-0
lines changed

.angular-cli.json

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

.editorconfig

+13
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

.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
readme.txt
36+
package-lock.json
37+
38+
# e2e
39+
/e2e/*.js
40+
/e2e/*.map
41+
42+
# System Files
43+
.DS_Store
44+
Thumbs.db

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 jeroenouw
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Angular | REST | Observables
2+
3+
In progess.

e2e/app.e2e-spec.ts

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

e2e/app.po.ts

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

e2e/tsconfig.e2e.json

+12
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+
}

karma.conf.js

+33
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+
};

package.json

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

protractor.conf.js

+28
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+
};

src/app/app.component.css

Whitespace-only changes.

src/app/app.component.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!--The whole content below can be removed with the new code.-->
2+
<div style="text-align:center">
3+
<h1>
4+
Welcome to {{title}}!!
5+
</h1>
6+
<img width="300" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyNTAgMjUwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNTAgMjUwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDojREQwMDMxO30NCgkuc3Qxe2ZpbGw6I0MzMDAyRjt9DQoJLnN0MntmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMTI1LDMwIDEyNSwzMCAxMjUsMzAgMzEuOSw2My4yIDQ2LjEsMTg2LjMgMTI1LDIzMCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAJIi8+DQoJPHBvbHlnb24gY2xhc3M9InN0MSIgcG9pbnRzPSIxMjUsMzAgMTI1LDUyLjIgMTI1LDUyLjEgMTI1LDE1My40IDEyNSwxNTMuNCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAxMjUsMzAgCSIvPg0KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMjUsNTIuMUw2Ni44LDE4Mi42aDBoMjEuN2gwbDExLjctMjkuMmg0OS40bDExLjcsMjkuMmgwaDIxLjdoMEwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMQ0KCQlMMTI1LDUyLjF6IE0xNDIsMTM1LjRIMTA4bDE3LTQwLjlMMTQyLDEzNS40eiIvPg0KPC9nPg0KPC9zdmc+DQo=" />
7+
</div>
8+
<h2>Here are some links to help you start: </h2>
9+
<ul>
10+
<li>
11+
<h2><a target="_blank" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12+
</li>
13+
<li>
14+
<h2><a target="_blank" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15+
</li>
16+
<li>
17+
<h2><a target="_blank" href="http://angularjs.blogspot.ca/">Angular blog</a></h2>
18+
</li>
19+
</ul>
20+

src/app/app.component.spec.ts

+32
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 'app'`, async(() => {
21+
const fixture = TestBed.createComponent(AppComponent);
22+
const app = fixture.debugElement.componentInstance;
23+
expect(app.title).toEqual('app');
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 app!!');
31+
}));
32+
});

src/app/app.component.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.css']
7+
})
8+
export class AppComponent {
9+
title = 'app';
10+
}

src/app/app.module.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
4+
import { AppComponent } from './app.component';
5+
6+
@NgModule({
7+
declarations: [
8+
AppComponent
9+
],
10+
imports: [
11+
BrowserModule
12+
],
13+
providers: [],
14+
bootstrap: [AppComponent]
15+
})
16+
export class AppModule { }

src/assets/.gitkeep

Whitespace-only changes.

src/environments/environment.prod.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
};

src/environments/environment.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// The file contents for the current environment will overwrite these during build.
2+
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
3+
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4+
// The list of which env maps to which file can be found in `.angular-cli.json`.
5+
6+
export const environment = {
7+
production: false
8+
};

src/favicon.ico

5.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)