Skip to content

Commit 3641afd

Browse files
author
Eric McGary
committed
angular quick start
1 parent dd1ece1 commit 3641afd

File tree

16 files changed

+156
-23
lines changed

16 files changed

+156
-23
lines changed

app/views/index.ejs

Lines changed: 0 additions & 17 deletions
This file was deleted.

package.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
"name": "ericmcgary",
33
"version": "0.1.0",
44
"description": "Personal website.",
5+
"license": "UNLICENSED",
6+
"private": true,
57
"scripts": {
6-
"start": "pm2 start ./app/server.js",
7-
"debug": "pm2-dev start ./app/server.js"
8+
"start": "pm2 start ./server/main.js",
9+
"debug": "pm2-dev start ./server/main.js",
10+
"typings": "typings",
11+
"postinstall": "typings install"
812
},
913
"repository": {
1014
"type": "git",
@@ -21,8 +25,17 @@
2125
"pm2": "^1.0.1",
2226
"serve-favicon": "~2.3.0",
2327
"tracer": "^0.8.3",
24-
"underscore": "^1.8.3"
28+
"underscore": "^1.8.3",
29+
"angular2": "2.0.0-beta.9",
30+
"systemjs": "0.19.24",
31+
"es6-promise": "^3.0.2",
32+
"es6-shim": "^0.33.3",
33+
"reflect-metadata": "0.1.2",
34+
"rxjs": "5.0.0-beta.2",
35+
"zone.js": "0.5.15"
2536
},
26-
"license": "UNLICENSED",
27-
"private": true
37+
"devDependencies":{
38+
"typescript": "^1.8.7",
39+
"typings":"^0.7.5"
40+
}
2841
}

public/app/app.js

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/app/app.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/app/app.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {Component} from 'angular2/core';
2+
3+
@Component({
4+
selector: 'my-app',
5+
template: '<h1>foo bar</h1>'
6+
})
7+
8+
export class AppComponent { }

public/app/main.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/app/main.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/app/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import {bootstrap} from 'angular2/platform/browser'
2+
import {AppComponent} from './app'
3+
4+
bootstrap(AppComponent);

public/favicon.ico

Whitespace-only changes.

public/styles/main.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
color:#333333;
3+
}

app/server.js renamed to server/main.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ app.use(bodyParser.json());
3737
app.use(bodyParser.urlencoded({ extended: false }));
3838
app.use(cookieParser());
3939
app.use(compression());
40-
app.use(express.static(path.join('./public')));
40+
41+
var publicFolder = path.join(__dirname, '../public');
42+
var nodeModulesFolder = path.join(__dirname, '../node_modules');
43+
44+
console.log(publicFolder, nodeModulesFolder);
45+
46+
app.use(express.static(publicFolder));
47+
app.use(express.static(nodeModulesFolder));
4148

4249
// route handling
4350

File renamed without changes.
File renamed without changes.

server/views/index.ejs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<html>
2+
3+
<head>
4+
5+
<title>Angular 2 QuickStart</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<link rel="stylesheet" href="/styles/main.css">
8+
9+
<!-- 1. Load libraries -->
10+
<!-- IE required polyfills, in this exact order -->
11+
<script src="/es6-shim/es6-shim.min.js"></script>
12+
<script src="/systemjs/dist/system-polyfills.js"></script>
13+
<script src="/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
14+
15+
<script src="/angular2/bundles/angular2-polyfills.js"></script>
16+
<script src="/systemjs/dist/system.src.js"></script>
17+
<script src="/rxjs/bundles/Rx.js"></script>
18+
<script src="/angular2/bundles/angular2.dev.js"></script>
19+
20+
<!-- 2. Configure SystemJS -->
21+
<script>
22+
System.config({
23+
packages: {
24+
app: {
25+
format: 'register',
26+
defaultExtension: 'js'
27+
}
28+
}
29+
});
30+
System.import('app/main').then(null, console.error.bind(console));
31+
</script>
32+
</head>
33+
34+
<!-- 3. Display the application -->
35+
<body>
36+
<my-app>Loading...</my-app>
37+
</body>
38+
39+
</html>

tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "system",
5+
"moduleResolution": "node",
6+
"sourceMap": true,
7+
"emitDecoratorMetadata": true,
8+
"experimentalDecorators": true,
9+
"removeComments": false,
10+
"noImplicitAny": false
11+
},
12+
"exclude": [
13+
"node_modules",
14+
"typings/main",
15+
"typings/main.d.ts"
16+
]
17+
}

typings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"ambientDependencies": {
3+
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
4+
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71"
5+
}
6+
}

0 commit comments

Comments
 (0)