Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
capoli committed Sep 19, 2015
1 parent c9ea77f commit debd121
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
node_modules/
.idea/
**/typings/
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# firstTsNgApp
This is for test purpose

Prerequisites:
- install node
- install typescript: npm install -g typescript
- install tsd package manager: npm install -g tsd
- install a node static server (for this project specific): npm install -g live-server

To be able to run the application:
- mkdir <dir> & cd <dir>
- git checkout https://github.com/capoli/firstTsNgApp.git
- npm install
- cd src
- tsd install
*** if tsd.json is missing execute form the src folder following command:
*** - tsd install angular2 es6-promise rx rx-lite --save

tsconfig schema: http://json.schemastore.org/tsconfig

To compile Typescript to Javascript execute from the root of the application folder:
- tsc -p src -w
*** this is to generate a .js file (and a .map.js file, helps debugger to navigate between js and ts) from a .ts file
*** with -w it will automatically watch for changes and recompile

To run the application execute from the root of the application folder:
live-server --open=src
15 changes: 15 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<script src="../node_modules/traceur/bin/traceur-runtime.js"></script>
<script src="../node_modules/es6-module-loader/dist/es6-module-loader.js"></script>
<script src="../node_modules/systemjs/dist/system.src.js"></script>
<script src="../node_modules/angular2/bundles/angular2.dev.js"></script>
</head>
<body>
<my-app></my-app>
<script>
System.import('js/app');
</script>
</body>
</html>
27 changes: 27 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var angular2_1 = require('angular2/angular2');
var AppComponent = (function () {
function AppComponent() {
}
AppComponent = __decorate([
angular2_1.Component({
selector: 'my-app'
}),
angular2_1.View({
template: '<h1 id="output">My fourth Angular 2 App</h1>'
}),
__metadata('design:paramtypes', [])
], AppComponent);
return AppComponent;
})();
angular2_1.bootstrap(AppComponent);
12 changes: 12 additions & 0 deletions src/ts/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {Component, View, bootstrap} from 'angular2/angular2';

@Component({
selector: 'my-app'
})
@View({
template: '<h1 id="output">My fourth Angular 2 App</h1>'
})

class AppComponent { }

bootstrap(AppComponent);
13 changes: 13 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"outDir":"js",
"rootDir":"ts",
"sourceMap":false,
"removeComments":true
}
}
21 changes: 21 additions & 0 deletions src/tsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"es6-promise/es6-promise.d.ts": {
"commit": "6f6e5c7dd9effe21fee14eb65fe340ecbbc8580a"
},
"rx/rx.d.ts": {
"commit": "6f6e5c7dd9effe21fee14eb65fe340ecbbc8580a"
},
"angular2/angular2.d.ts": {
"commit": "6f6e5c7dd9effe21fee14eb65fe340ecbbc8580a"
},
"rx/rx-lite.d.ts": {
"commit": "6f6e5c7dd9effe21fee14eb65fe340ecbbc8580a"
}
}
}
Empty file added src/views/show-properties.html
Empty file.

0 comments on commit debd121

Please sign in to comment.