Skip to content

Instantly share code, notes, and snippets.

@FlorianBELLAZOUZ
Last active December 29, 2015 16:11
Show Gist options
  • Select an option

  • Save FlorianBELLAZOUZ/c474cf84463aebe9bc3a to your computer and use it in GitHub Desktop.

Select an option

Save FlorianBELLAZOUZ/c474cf84463aebe9bc3a to your computer and use it in GitHub Desktop.
Basic bootstarp for Angular 2.0
// app/app.ts
import {bootstrap} from 'angular2/platform/browser';
import {Component} from 'angular2/core';
@Component({
selector:"app",
template:"<h1>coucou</h1>"
})
class TodoApp {}
bootstrap(TodoApp);
<!DOCTYPE html>
<html>
<head>
<title>Todo</title>
<meta charset="utf-8">
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script>
System.config({
packages: {
app: {
format: 'cjs',
defaultExtension: 'js'
}
}
});
System.import('app/app')
.then(null, console.error.bind(console));
</script>
</head>
<body>
<app></app>
</body>
</html>
{
"name": "todo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "concurrent \"tsc -w\" \"lite-server\""
},
"author": "Florian BELLAZOUZ",
"devDependencies": {
"typescript": "^1.7.5",
"concurrently": "^1.0.0",
"lite-server": "^1.3.1"
},
"dependencies": {
"angular2": "^2.0.0-beta.0",
"systemjs": "^0.19.9"
}
}
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false
},
"exclude": [
"node_modules"
]
}
@FlorianBELLAZOUZ
Copy link
Copy Markdown
Author

npm install
npm start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment