docs(QuickStart): rewritten for 52 and latest recommendations
closes #472
This commit is contained in:
@@ -16,7 +16,12 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"angular2": "^2.0.0-alpha.51",
|
||||
"systemjs": "0.19.6"
|
||||
"systemjs": "0.19.6",
|
||||
"es6-promise": "^3.0.2",
|
||||
"es6-shim": "^0.33.3",
|
||||
"reflect-metadata": "0.1.2",
|
||||
"rxjs": "5.0.0-alpha.14",
|
||||
"zone.js": "0.5.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^1.0.0",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// #docregion
|
||||
// #docregion import
|
||||
import {Component} from 'angular2/core';
|
||||
// #enddocregion import
|
||||
|
||||
// #docregion metadata
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template: '<h1>My First Angular 2 App</h1>'
|
||||
})
|
||||
// #enddocregion metadata
|
||||
export class AppComponent { }
|
||||
@@ -0,0 +1,7 @@
|
||||
// #docregion
|
||||
import {bootstrap} from 'angular2/platform/browser'
|
||||
// #docregion app-component
|
||||
import {AppComponent} from './app.component'
|
||||
// #enddocregion app-component
|
||||
|
||||
bootstrap(AppComponent);
|
||||
+11
-3
@@ -4,22 +4,30 @@
|
||||
|
||||
<head>
|
||||
<title>Angular 2 QuickStart</title>
|
||||
|
||||
<!-- 1. Load libraries -->
|
||||
<!-- #docregion libraries -->
|
||||
<script src="../node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="../node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||
<!-- #enddocregion libraries -->
|
||||
|
||||
<!-- 2. Configure SystemJS -->
|
||||
<!-- #docregion systemjs -->
|
||||
<script>
|
||||
System.config({
|
||||
packages: {'app': {defaultExtension: 'js'}}
|
||||
});
|
||||
System.import('app/app');
|
||||
System.import('app/boot');
|
||||
</script>
|
||||
<!-- #enddocregion systemjs -->
|
||||
|
||||
</head>
|
||||
|
||||
<!-- 3. Display the application -->
|
||||
<!-- #docregion my-app -->
|
||||
<body>
|
||||
<my-app>Loading...</my-app>
|
||||
</body>
|
||||
<!-- #enddocregion my-app -->
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "angular2-quickstart",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"lite": "lite-server",
|
||||
"both": "concurrent \"npm run tsc:w\" \"npm run lite\" "
|
||||
},
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"angular2": "2.0.0-alpha.52",
|
||||
"systemjs": "0.19.6",
|
||||
"es6-promise": "^3.0.2",
|
||||
"es6-shim": "^0.33.3",
|
||||
"reflect-metadata": "0.1.2",
|
||||
"rxjs": "5.0.0-alpha.14",
|
||||
"zone.js": "0.5.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^1.0.0",
|
||||
"lite-server": "^1.3.1",
|
||||
"typescript": "^1.7.3"
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,11 @@
|
||||
{
|
||||
"name": "angular2-getting-started",
|
||||
"name": "angular2-quickstart",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"tsc": "tsc -p src -w",
|
||||
"start": "live-server --open=src"
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"lite": "lite-server",
|
||||
"both": "concurrent \"npm run tsc:w\" \"npm run lite\" "
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"angular2": "2.0.0-alpha.44",
|
||||
"systemjs": "0.19.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"live-server": "^0.8.1",
|
||||
"typescript": "^1.6.2"
|
||||
}
|
||||
"license": "ISC"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"description": "QuickStart",
|
||||
"files": [
|
||||
"!**/*.d.ts",
|
||||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"tags": ["quickstart"]
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
// #docregion
|
||||
import {bootstrap, Component} from 'angular2/angular2';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template: '<h1>My First Angular 2 App</h1>'
|
||||
})
|
||||
class AppComponent { }
|
||||
|
||||
bootstrap(AppComponent);
|
||||
@@ -1,10 +0,0 @@
|
||||
// #docregion
|
||||
import {bootstrap, Component} from 'angular2/angular2';
|
||||
|
||||
@Component({
|
||||
selector: 'my-app',
|
||||
template: '<h1>My First Angular 2 App</h1>'
|
||||
})
|
||||
class AppComponent { }
|
||||
|
||||
bootstrap(AppComponent);
|
||||
@@ -1,23 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- #docregion -->
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Angular 2 QuickStart</title>
|
||||
<script src="https://code.angularjs.org/tools/system.js"></script>
|
||||
<script src="https://code.angularjs.org/tools/typescript.js"></script>
|
||||
<script src="https://code.angularjs.org/2.0.0-alpha.44/angular2.dev.js"></script>
|
||||
<script>
|
||||
System.config({
|
||||
transpiler: 'typescript',
|
||||
typescriptOptions: { emitDecoratorMetadata: true }
|
||||
});
|
||||
System.import('./app.ts');
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<my-app>loading...</my-app>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"description": "QuickStart Application",
|
||||
"files": ["app/app.ts", "index.html"],
|
||||
"tags": ["quickstart"]
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"description": "Alternate Quickstart",
|
||||
"files": ["!app/app.ts", "!*.html", "index.1.html" ],
|
||||
"main": "index.1.html"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "system",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"removeComments": false,
|
||||
"noImplicitAny": false
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
+7
-3
@@ -1,11 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES5",
|
||||
"module": "commonjs",
|
||||
"module": "system",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"removeComments": false,
|
||||
"noImplicitAny": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,22 +40,22 @@ var _rxData = [
|
||||
{
|
||||
pattern: 'script',
|
||||
from: 'node_modules/angular2/bundles/angular2.dev.js',
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.51/angular2.dev.js'
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.52/angular2.dev.js'
|
||||
},
|
||||
{
|
||||
pattern: 'script',
|
||||
from: 'node_modules/angular2/bundles/router.dev.js',
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.51/router.dev.js'
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.52/router.dev.js'
|
||||
},
|
||||
{
|
||||
pattern: 'script',
|
||||
from: 'node_modules/angular2/bundles/http.dev.js',
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.51/http.dev.js'
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.52/http.dev.js'
|
||||
},
|
||||
{
|
||||
pattern: 'script',
|
||||
from: 'node_modules/angular2/bundles/testing.js',
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.51/testing.js'
|
||||
to: 'https://code.angularjs.org/2.0.0-alpha.52/testing.js'
|
||||
},
|
||||
{
|
||||
pattern: 'link',
|
||||
|
||||
@@ -95,7 +95,7 @@ function initConfigAndCollectFileNames(configFileName) {
|
||||
}
|
||||
});
|
||||
// var defaultExcludes = [ '!**/node_modules/**','!**/typings/**','!**/tsconfig.json', '!**/*plnkr.json', '!**/*plnkr.html', '!**/*plnkr.no-link.html' ];
|
||||
var defaultExcludes = [ '!**/typings/**','!**/tsconfig.json', '!**/*plnkr.json', '!**/*plnkr.html', '!**/*plnkr.no-link.html' ];
|
||||
var defaultExcludes = [ '!**/typings/**','!**/tsconfig.json', '!**/*plnkr.json', '!**/*plnkr.html', '!**/*plnkr.no-link.html', '!**/package.json' ];
|
||||
Array.prototype.push.apply(gpaths, defaultExcludes);
|
||||
|
||||
config.fileNames = globby.sync(gpaths, { ignore: ["**/node_modules/**"] });
|
||||
|
||||
Reference in New Issue
Block a user