Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update to rc1 #47

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
npm-debug.log
dist
dist
typings
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ A minimal [Angular2](https://angular.io/) playground using [TypeScript](http://w

Clone this repo and execute in your favourite shell:

* `npm i -g gulp` to install gulp globally (if you don't have it installed already)
* `npm i -g gulp typings` to install gulp and typings globally (if you don't have it installed already)
* `npm i` to install local npm dependencies

## Play

After completing installation type in your favourite shell:

* `gulp play` to start a "Hello World" app in a new browser window. App files are observed and will be re-transpiled on each change.
* `gulp play` to start a "Hello World" app in a new browser window. App files are observed and will be re-transpiled on each change.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gulp.task('ts2js', function () {
var tscConfig = require('./tsconfig.json');

var tsResult = gulp
.src([PATHS.src, 'node_modules/angular2/typings/browser.d.ts'])
.src([PATHS.src, 'typings/index.d.ts'])
.pipe(typescript(tscConfig.compilerOptions));

return tsResult.js.pipe(gulp.dest('dist'));
Expand Down
53 changes: 46 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Angular2 playground</title>
</head>

Expand All @@ -10,18 +12,55 @@
</body>

<!-- ES6-related imports -->
<script src="/node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="/node_modules/es6-shim/es6-shim.min.js"></script>
<script src="/node_modules/systemjs/dist/system.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.js"></script>
<script>
//configure system loader
System.config({defaultJSExtensions: true});
System.config({
packages: {
'@angular/common': {
main: 'index'
},
'@angular/compiler': {
main: 'index'
},
'@angular/core': {
main: 'index'
},
'@angular/http': {
main: 'index'
},
'@angular/platform-browser-dynamic': {
main: 'index'
},
'@angular/platform-browser': {
main: 'index'
},
'@angular/router': {
main: 'index'
},
"rxjs": {
defaultExtension: 'js'
},
'dist': {
defaultExtension: 'js',
format: 'register'
},
},
paths: {
'@angular/*': 'node_modules/@angular/*',
"rxjs/*": "node_modules/rxjs/*",
"reflect-metadata": "node_modules/reflect-metadata"
},
map: {
"rxjs": "node_modules/rxjs"
}
});
</script>
<script src="/node_modules/rxjs/bundles/Rx.js"></script>
<script src="/node_modules/angular2/bundles/angular2.js"></script>
<script>
//bootstrap the Angular2 application
System.import('dist/hello').catch(console.log.bind(console));
</script>

</html>
</html>
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"url": "https://github.com/pkozlowski-opensource/ng2-play.ts/issues"
},
"homepage": "https://github.com/pkozlowski-opensource/ng2-play.ts#readme",
"scripts": {
"postinstall": "typings install"
},
"devDependencies": {
"connect": "^3.4.0",
"del": "^1.2.0",
Expand All @@ -19,11 +22,18 @@
"serve-static": "^1.10.0"
},
"dependencies": {
"angular2": "2.0.0-beta.16",
"es6-shim": "0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "0.6.12",
"systemjs": "0.19.6"
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"core-js": "^2.2.1",
"es6-shim": "^0.35.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "^0.19.25",
"zone.js": "0.6.12"
}
}
4 changes: 2 additions & 2 deletions src/hello.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {Component} from '@angular/core';
import {bootstrap} from '@angular/platform-browser-dynamic';

@Component({
selector: 'hello-app',
Expand Down
10 changes: 10 additions & 0 deletions typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "ng2-play",
"version": false,
"dependencies": {
"es6-promise": "registry:npm/es6-promise#3.0.0+20160211003958"
},
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654"
}
}