Skip to content

Commit 2e9ee38

Browse files
committed
Initial commit
0 parents  commit 2e9ee38

Some content is hidden

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

48 files changed

+1121
-0
lines changed

.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

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
dist/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# IDEs and editors
10+
.idea/
11+
.project
12+
.classpath
13+
.c9/
14+
*.launch
15+
.settings/
16+
*.sublime-workspace
17+
18+
# IDE - VSCode
19+
.vscode/*
20+
!.vscode/settings.json
21+
!.vscode/tasks.json
22+
!.vscode/launch.json
23+
!.vscode/extensions.json
24+
25+
# misc
26+
.sass-cache
27+
connect.lock
28+
coverage/
29+
npm-debug.log
30+
testem.log
31+
typings/
32+
33+
# e2e
34+
**/e2e/*.js
35+
**/e2e/*.map
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
*.log
42+
*.lock
43+
*-lock.json

.travis.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
group: edge
2+
3+
language: node_js
4+
5+
node_js:
6+
- 6
7+
- 7
8+
- 8
9+
10+
install: true
11+
12+
before_install:
13+
- export CHROME_BIN=/usr/bin/google-chrome
14+
- export DISPLAY=:99.0
15+
- sh -e /etc/init.d/xvfb start
16+
- sudo apt update
17+
- sudo apt install -y libappindicator1 fonts-liberation
18+
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
19+
- sudo dpkg -i google-chrome*.deb
20+
21+
before_script:
22+
- npm i -g yarn
23+
24+
script:
25+
- export ROOT=$PWD
26+
- >
27+
for path in \
28+
02-angular4-redux-todo \
29+
01-angular4-service-worker
30+
do
31+
32+
export TARGET="$ROOT/$path";
33+
cd $TARGET;
34+
35+
yarn install;
36+
yarn predeploy;
37+
if [ -f npm-debug.log ]; then cat npm-debug.log; fi;
38+
39+
yarn global add npm-check-updates
40+
ncu -u
41+
42+
done;
43+
44+
cache:
45+
directories:
46+
- ./*/node_modules/
47+
- $HOME/.npm
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "angular4-redux-todo"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
10+
"assets": [
11+
"./assets",
12+
"./favicon.ico",
13+
"./service-worker-register.js",
14+
"./service-worker.js"
15+
],
16+
"index": "index.html",
17+
"main": "main.ts",
18+
"polyfills": "polyfills.ts",
19+
"tsconfig": "tsconfig.app.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+
"lint": [
33+
{
34+
"project": "./src/tsconfig.app.json"
35+
}
36+
],
37+
"defaults": {
38+
"styleExt": "css",
39+
"component": {}
40+
}
41+
}
+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

01-angular4-service-worker/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Angular Examples [![Build Status](https://travis-ci.org/daggerok/angular-examples.svg)](https://travis-ci.org/daggerok/angular-examples)
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.6.
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).
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"homepage": "https://daggerok.github.io/angular-examples",
3+
"name": "angular-examples",
4+
"version": "0.0.1",
5+
"license": "MIT",
6+
"scripts": {
7+
"ng": "ng",
8+
"start": "ng serve",
9+
"build": "ng build --prod --aot",
10+
"lint": "ng lint",
11+
"preserve": "yarn -i; npm-run-all preserve:*",
12+
"preserve:build": "yarn build",
13+
"preserve:serve": "serve -C -p 3000 -s -o ./dist",
14+
"predeploy": "yarn -i; npm-run-all predeploy:*",
15+
"predeploy:build": "yarn build -- --base-href='/angular-examples/'",
16+
"predeploy:404-html": "ncp ./dist/index.html ./dist/404.html",
17+
"deploy": "gh-pages -d ./dist -b gh-pages -m \"Github Pages $(date +%Y-%m-%d) deployment\""
18+
},
19+
"private": true,
20+
"dependencies": {
21+
"@angular/common": "4.4.1",
22+
"@angular/compiler": "4.4.1",
23+
"@angular/core": "4.4.1",
24+
"@angular/forms": "4.4.1",
25+
"@angular/http": "4.4.1",
26+
"@angular/platform-browser": "4.4.1",
27+
"@angular/platform-browser-dynamic": "4.4.1",
28+
"@angular/router": "4.4.1",
29+
"core-js": "2.5.1",
30+
"rxjs": "5.4.3",
31+
"zone.js": "0.8.17"
32+
},
33+
"devDependencies": {
34+
"@angular/cli": "1.4.2",
35+
"@angular/compiler-cli": "4.4.1",
36+
"@types/node": "8.0.28",
37+
"codelyzer": "3.2.0",
38+
"gh-pages": "1.0.0",
39+
"livereload": "0.6.2",
40+
"ncp": "2.0.0",
41+
"npm-run-all": "4.1.1",
42+
"serve": "6.1.0",
43+
"ts-node": "3.3.0",
44+
"tslint": "5.7.0",
45+
"typescript": "^2.5.2"
46+
},
47+
"livereload": {
48+
"exclusions": [
49+
"node_modules",
50+
"*.json",
51+
"README.*",
52+
"yarn.lock"
53+
]
54+
}
55+
}

01-angular4-service-worker/src/app/app.component.css

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h1>
2+
{{title}}
3+
</h1>
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 = 'Angular 4 Service Worker';
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { BrowserModule } from '@angular/platform-browser';
2+
import { NgModule } from '@angular/core';
3+
import { FormsModule } from '@angular/forms';
4+
import { HttpModule } from '@angular/http';
5+
6+
import { AppComponent } from './app.component';
7+
8+
@NgModule({
9+
declarations: [
10+
AppComponent
11+
],
12+
imports: [
13+
BrowserModule,
14+
FormsModule,
15+
HttpModule
16+
],
17+
providers: [],
18+
bootstrap: [AppComponent]
19+
})
20+
export class AppModule { }

01-angular4-service-worker/src/assets/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
};
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+
};
5.3 KB
Binary file not shown.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<script src="./service-worker-register.js" async></script>
5+
<meta charset="utf-8">
6+
<title>Angular 4 Service Worker</title>
7+
<base href="/">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<link rel="icon" type="image/x-icon" href="favicon.ico">
10+
</head>
11+
<body>
12+
<app-root>Loading...</app-root>
13+
</body>
14+
</html>
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { enableProdMode } from '@angular/core';
2+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3+
4+
import { AppModule } from './app/app.module';
5+
import { environment } from './environments/environment';
6+
7+
if (environment.production) {
8+
enableProdMode();
9+
}
10+
11+
platformBrowserDynamic().bootstrapModule(AppModule);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/**
2+
* This file includes polyfills needed by Angular and is loaded before the app.
3+
* You can add your own extra polyfills to this file.
4+
*
5+
* This file is divided into 2 sections:
6+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8+
* file.
9+
*
10+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13+
*
14+
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15+
*/
16+
17+
/***************************************************************************************************
18+
* BROWSER POLYFILLS
19+
*/
20+
21+
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
22+
// import 'core-js/es6/symbol';
23+
// import 'core-js/es6/object';
24+
// import 'core-js/es6/function';
25+
// import 'core-js/es6/parse-int';
26+
// import 'core-js/es6/parse-float';
27+
// import 'core-js/es6/number';
28+
// import 'core-js/es6/math';
29+
// import 'core-js/es6/string';
30+
// import 'core-js/es6/date';
31+
// import 'core-js/es6/array';
32+
// import 'core-js/es6/regexp';
33+
// import 'core-js/es6/map';
34+
// import 'core-js/es6/set';
35+
36+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
37+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
38+
39+
/** IE10 and IE11 requires the following to support `@angular/animation`. */
40+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
41+
42+
43+
/** Evergreen browsers require these. **/
44+
import 'core-js/es6/reflect';
45+
import 'core-js/es7/reflect';
46+
47+
48+
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
49+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
50+
51+
52+
53+
/***************************************************************************************************
54+
* Zone JS is required by Angular itself.
55+
*/
56+
import 'zone.js/dist/zone'; // Included with Angular CLI.
57+
58+
59+
60+
/***************************************************************************************************
61+
* APPLICATION IMPORTS
62+
*/
63+
64+
/**
65+
* Date, currency, decimal and percent pipes.
66+
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
67+
*/
68+
// import 'intl'; // Run `npm install --save intl`.
69+
/**
70+
* Need to import at least one locale-data with intl.
71+
*/
72+
// import 'intl/locale-data/jsonp/en';

0 commit comments

Comments
 (0)