Skip to content

Commit 89d876b

Browse files
Andrzej FriczeAndrzej Fricze
Andrzej Fricze
authored and
Andrzej Fricze
committed
Add two chapters about Observable gallery
1 parent f8b11b4 commit 89d876b

File tree

102 files changed

+29791
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+29791
-0
lines changed

SUMMARY.md

+3
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@
4646
* [GET](crud-and-http/GET.md)
4747
* [DELETE and PUT](crud-and-http/DELETE_PUT.md)
4848

49+
* [Gallery with Rx.js](observable-gallery/hello.md)
50+
* [\#1: Gallery 101. Display photos](observable-gallery/display-photos.md)
51+
* [\#2: More interaction! Upload photos](observable-gallery/upload-photos.md)

book.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"plugins": ["hints", "codetabs"]
3+
}
6 KB
Binary file not shown.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Datafy
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.4.
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|guard|interface|enum|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+
25+
## Further help
26+
27+
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).
+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"datafy": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/datafy",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"aot": false,
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets"
29+
],
30+
"styles": [
31+
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
32+
"src/styles.scss"
33+
],
34+
"scripts": []
35+
},
36+
"configurations": {
37+
"production": {
38+
"fileReplacements": [
39+
{
40+
"replace": "src/environments/environment.ts",
41+
"with": "src/environments/environment.prod.ts"
42+
}
43+
],
44+
"optimization": true,
45+
"outputHashing": "all",
46+
"sourceMap": false,
47+
"extractCss": true,
48+
"namedChunks": false,
49+
"aot": true,
50+
"extractLicenses": true,
51+
"vendorChunk": false,
52+
"buildOptimizer": true,
53+
"budgets": [
54+
{
55+
"type": "initial",
56+
"maximumWarning": "2mb",
57+
"maximumError": "5mb"
58+
},
59+
{
60+
"type": "anyComponentStyle",
61+
"maximumWarning": "6kb",
62+
"maximumError": "10kb"
63+
}
64+
]
65+
}
66+
}
67+
},
68+
"serve": {
69+
"builder": "@angular-devkit/build-angular:dev-server",
70+
"options": {
71+
"browserTarget": "datafy:build"
72+
},
73+
"configurations": {
74+
"production": {
75+
"browserTarget": "datafy:build:production"
76+
}
77+
}
78+
},
79+
"extract-i18n": {
80+
"builder": "@angular-devkit/build-angular:extract-i18n",
81+
"options": {
82+
"browserTarget": "datafy:build"
83+
}
84+
},
85+
"test": {
86+
"builder": "@angular-devkit/build-angular:karma",
87+
"options": {
88+
"main": "src/test.ts",
89+
"polyfills": "src/polyfills.ts",
90+
"tsConfig": "tsconfig.spec.json",
91+
"karmaConfig": "karma.conf.js",
92+
"assets": [
93+
"src/favicon.ico",
94+
"src/assets"
95+
],
96+
"styles": [
97+
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
98+
"src/styles.scss"
99+
],
100+
"scripts": []
101+
}
102+
},
103+
"lint": {
104+
"builder": "@angular-devkit/build-angular:tslint",
105+
"options": {
106+
"tsConfig": [
107+
"tsconfig.app.json",
108+
"tsconfig.spec.json",
109+
"e2e/tsconfig.json"
110+
],
111+
"exclude": [
112+
"**/node_modules/**"
113+
]
114+
}
115+
},
116+
"e2e": {
117+
"builder": "@angular-devkit/build-angular:protractor",
118+
"options": {
119+
"protractorConfig": "e2e/protractor.conf.js",
120+
"devServerTarget": "datafy:serve"
121+
},
122+
"configurations": {
123+
"production": {
124+
"devServerTarget": "datafy:serve:production"
125+
}
126+
}
127+
}
128+
}
129+
}
130+
},
131+
"defaultProject": "datafy"
132+
}
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
// Protractor configuration file, see link for more information
3+
// https://github.com/angular/protractor/blob/master/lib/config.ts
4+
5+
const { SpecReporter } = require('jasmine-spec-reporter');
6+
7+
/**
8+
* @type { import("protractor").Config }
9+
*/
10+
exports.config = {
11+
allScriptsTimeout: 11000,
12+
specs: [
13+
'./src/**/*.e2e-spec.ts'
14+
],
15+
capabilities: {
16+
'browserName': 'chrome'
17+
},
18+
directConnect: true,
19+
baseUrl: 'http://localhost:4200/',
20+
framework: 'jasmine',
21+
jasmineNodeOpts: {
22+
showColors: true,
23+
defaultTimeoutInterval: 30000,
24+
print: function() {}
25+
},
26+
onPrepare() {
27+
require('ts-node').register({
28+
project: require('path').join(__dirname, './tsconfig.json')
29+
});
30+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
}
32+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('datafy app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo() {
5+
return browser.get(browser.baseUrl) as Promise<any>;
6+
}
7+
8+
getTitleText() {
9+
return element(by.css('app-root .content span')).getText() as Promise<string>;
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
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-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require('path').join(__dirname, './coverage/datafy'),
20+
reports: ['html', 'lcovonly', 'text-summary'],
21+
fixWebpackSourcePaths: true
22+
},
23+
reporters: ['progress', 'kjhtml'],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_INFO,
27+
autoWatch: true,
28+
browsers: ['Chrome'],
29+
singleRun: false,
30+
restartOnFileChange: true
31+
});
32+
};

0 commit comments

Comments
 (0)