Skip to content

Commit b6bbbe9

Browse files
committed
initial commit
0 parents  commit b6bbbe9

File tree

128 files changed

+8890
-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.

128 files changed

+8890
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
insert_final_newline = false
13+
trim_trailing_whitespace = false

.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.ts eol=lf
2+
*.js eol=lf
3+
*.html eol=lf
4+
*.css eol=lf
5+
*.md eol=lf
6+
*.json eol=lf
7+
*.yml eol=lf

.gitignore

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
16+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17+
.grunt
18+
19+
# Compiled binary addons (http://nodejs.org/api/addons.html)
20+
build/Release
21+
22+
# Users Environment Variables
23+
.lock-wscript
24+
25+
# OS generated files #
26+
.DS_Store
27+
ehthumbs.db
28+
Icon?
29+
Thumbs.db
30+
31+
# Node Files #
32+
/node_modules
33+
/bower_components
34+
35+
# Typing TSD #
36+
/src/typings/tsd/
37+
/typings/
38+
/tsd_typings/
39+
40+
# Dist #
41+
/dist
42+
/public/__build__/
43+
/src/*/__build__/
44+
__build__/**
45+
.webpack.json
46+
47+
48+
# IDE #
49+
.idea/
50+
51+
# generated documents
52+
/doc

.npmignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.npmignore
2+
.gitignore
3+
.gitmodules
4+
.travis.yml
5+
.coveralls.yml
6+
7+
test/
8+
node_modules/
9+
coverage/

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sudo: required
2+
dist: trusty
3+
language: node_js
4+
cache:
5+
directories:
6+
- node_modules
7+
node_js:
8+
- '5.0.0'
9+
after_success:
10+
- scripts/push-to-ghpages.sh

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Akira Sosa
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.
22+

README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Angular2 Tutorial
2+
3+
This repository is an example application for angular2 tutorial.
4+
5+
[![Build Status][travis-image]][travis-url]
6+
7+
## Getting Started
8+
9+
Prepare backend app.
10+
11+
```
12+
git clone https://github.com/springboot-angular2-tutorial/boot-app.git
13+
cd boot-app
14+
mvn spring-boot:run
15+
```
16+
17+
Serve frontend app by webpack-dev-server.
18+
19+
```
20+
npm install
21+
npm install -g webpack webpack-dev-server karma-cli
22+
npm run server
23+
open http://localhost:8080
24+
```
25+
26+
Testing.
27+
28+
```
29+
npm test
30+
```
31+
32+
## Tutorial
33+
34+
Under construction...
35+
36+
## Credits
37+
38+
* [Rails tutorial](https://github.com/railstutorial/sample_app_rails_4)
39+
* [angular2-webpack-starter](https://github.com/AngularClass/angular2-webpack-starter)
40+
* [angular2-seed](https://github.com/mgechev/angular2-seed)
41+
42+
## License
43+
44+
[MIT](/LICENSE)
45+
46+
[travis-url]: https://travis-ci.org/springboot-angular2-tutorial/angular2-app
47+
[travis-image]: https://travis-ci.org/springboot-angular2-tutorial/angular2-app.svg

karma.conf.js

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
module.exports = function (config) {
2+
var _config = {
3+
4+
basePath: '',
5+
frameworks: ['jasmine'],
6+
files: [
7+
{pattern: './src/lib/es6-shim.js', watched: false},
8+
{pattern: 'spec.bundle.js', watched: false}
9+
],
10+
exclude: [],
11+
preprocessors: {
12+
'spec.bundle.js': ['webpack', 'sourcemap']
13+
},
14+
webpack: {
15+
resolve: {
16+
root: __dirname,
17+
extensions: ['', '.ts', '.js', '.json'],
18+
alias: {
19+
'app': 'src/app',
20+
'common': 'src/common'
21+
}
22+
},
23+
devtool: 'inline-source-map',
24+
module: {
25+
loaders: [
26+
{
27+
test: /\.ts$/,
28+
loader: 'ts',
29+
query: {
30+
ignoreDiagnostics: [
31+
2300,
32+
2383,
33+
2375,
34+
2374
35+
]
36+
},
37+
exclude: [
38+
/\.min\.js$/
39+
]
40+
},
41+
{test: /reflect-metadata/, loader: "imports?require=>false"},
42+
{test: /\.json$/, loader: 'json'},
43+
{test: /\.html$/, loader: 'raw'},
44+
{test: /\.css$/, loader: 'raw'},
45+
{
46+
test: /\.scss$/,
47+
loaders: ["raw", "sass"]
48+
},
49+
{
50+
test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
51+
loader: 'url?limit=10000&mimetype=application/font-woff'
52+
},
53+
{
54+
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
55+
loader: 'url?limit=10000&mimetype=application/octet-stream'
56+
},
57+
{test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file'},
58+
{
59+
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
60+
loader: 'url?limit=10000&mimetype=image/svg+xml'
61+
}
62+
]
63+
},
64+
stats: {colors: true, reasons: true},
65+
debug: true
66+
},
67+
webpackServer: {
68+
noInfo: true
69+
},
70+
reporters: ['mocha'],
71+
port: 9876,
72+
colors: true,
73+
logLevel: config.LOG_INFO,
74+
autoWatch: true,
75+
browsers: ['PhantomJS2'],
76+
singleRun: true
77+
};
78+
79+
config.set(_config);
80+
};

package.json

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "angular2-tutorial",
3+
"version": "0.1.0",
4+
"description": "Angular2 tutorial sample application",
5+
"main": "",
6+
"scripts": {
7+
"build": "npm run webpack --colors --display-error-details --display-cached",
8+
"webpack": "webpack",
9+
"clean": "rimraf node_modules tsd_typings",
10+
"clean-install": "npm run clean && npm install",
11+
"clean-start": "npm run clean && npm start",
12+
"prequick-start": "npm install",
13+
"watch": "webpack --watch",
14+
"server": "webpack-dev-server --inline --colors --display-error-details --display-cached --port 3001",
15+
"test": "karma start",
16+
"tsd-update": "tsd reinstall --overwrite",
17+
"docs": "typedoc --options typedoc.json src/**/*.ts",
18+
"postinstall": "npm run tsd-update && tsd install && tsd link",
19+
"start": "npm run server"
20+
},
21+
"repository": {
22+
"type": "git",
23+
"url": "https://github.com/springboot-angular2-tutorial/angular2-app.git"
24+
},
25+
"author": "akirasosa <akirasosa@gmail.com>",
26+
"license": "MIT",
27+
"bugs": {
28+
"url": "https://github.com/springboot-angular2-tutorial/angular2-app/issues"
29+
},
30+
"homepage": "https://github.com/springboot-angular2-tutorial/angular2-app",
31+
"dependencies": {
32+
"@reactivex/rxjs": "5.0.0-alpha.7",
33+
"angular2": "2.0.0-alpha.44",
34+
"bootstrap": "^3.3.5",
35+
"jquery": "^2.1.4",
36+
"jwt-decode": "^1.4.0",
37+
"lodash": "^3.10.1",
38+
"md5-hex": "^1.1.0",
39+
"moment": "^2.10.6",
40+
"ng2-bootstrap": "https://github.com/akirasosa/ng2-bootstrap.git",
41+
"pluralize": "^1.2.1",
42+
"reflect-metadata": "0.1.2",
43+
"time-ago": "^0.1.0",
44+
"toastr": "^2.1.2",
45+
"zone.js": "0.5.8"
46+
},
47+
"devDependencies": {
48+
"bootstrap-webpack": "0.0.5",
49+
"css-loader": "^0.22.0",
50+
"exports-loader": "^0.6.2",
51+
"expose-loader": "^0.7.0",
52+
"file-loader": "^0.8.4",
53+
"imports-loader": "^0.6.4",
54+
"jasmine-core": "^2.3.4",
55+
"json-loader": "^0.5.3",
56+
"karma": "^0.13.11",
57+
"karma-chrome-launcher": "^0.2.1",
58+
"karma-jasmine": "^0.3.6",
59+
"karma-mocha-reporter": "^1.1.1",
60+
"karma-notify-reporter": "^0.1.1",
61+
"karma-phantomjs2-launcher": "0.3.2",
62+
"karma-sourcemap-loader": "^0.3.6",
63+
"karma-webpack": "^1.7.0",
64+
"less": "^2.5.3",
65+
"less-loader": "^2.2.1",
66+
"node-sass": "^3.4.1",
67+
"raw-loader": "^0.5.1",
68+
"rimraf": "2.4.3",
69+
"sass-loader": "^3.1.1",
70+
"style-loader": "^0.13.0",
71+
"ts-loader": "0.6.0",
72+
"tsd": "^0.6.5",
73+
"typescript": "^1.6.2",
74+
"url-loader": "^0.5.6",
75+
"webpack": "^1.12.2",
76+
"webpack-dev-server": "^1.12.1"
77+
}
78+
}

scripts/push-to-ghpages.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
rm -rf out || exit 0;
4+
NODE_ENV=production npm run build
5+
cp -rf __build__ out
6+
7+
(
8+
cd out
9+
git init
10+
git config user.name "Travis-CI"
11+
git config user.email "travis@example.com"
12+
git add .
13+
git commit -m "Deployed to Github Pages"
14+
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
15+
)
16+

spec.bundle.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Error.stackTraceLimit = Infinity;
2+
require('reflect-metadata');
3+
require('angular2/test');
4+
require('angular2/mock');
5+
6+
browser_adapter = require('angular2/src/core/dom/browser_adapter');
7+
browser_adapter.BrowserDomAdapter.makeCurrent();
8+
9+
var ctx = require.context('./src', true, /\.spec\.ts/);
10+
11+
ctx.keys().forEach(function (path) {
12+
var module = ctx(path);
13+
if (module.hasOwnProperty('main')) {
14+
module.main();
15+
} else {
16+
throw new Error('Module ' + path + ' does not implement main() method.');
17+
}
18+
});

0 commit comments

Comments
 (0)