Created
August 15, 2016 09:40
-
-
Save airportyh/512b9246b246ebbe70a416022658e891 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'my-app', | |
| template: '<h1>Hello World</h1>' | |
| }) | |
| export class AppComponent { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { AppComponent } from './app.component'; | |
| import { FormsModule } from '@angular/forms'; | |
| @NgModule({ | |
| imports: [ BrowserModule, FormsModule ], | |
| declarations: [ AppComponent ], | |
| bootstrap: [ AppComponent ] | |
| }) | |
| export class AppModule { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <base href="/"> | |
| <title>Angular 2 QuickStart</title> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href="styles.css"> | |
| <!-- 1. Load libraries --> | |
| <!-- Polyfill(s) for older browsers --> | |
| <script src="node_modules/core-js/client/shim.min.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.src.js"></script> | |
| <!-- 2. Configure SystemJS --> | |
| <script src="systemjs.config.js"></script> | |
| <script> | |
| System.import('app').catch(function(err){ console.error(err); }); | |
| </script> | |
| </head> | |
| <!-- 3. Display the application --> | |
| <body> | |
| <my-app>Loading...</my-app> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |
| import { AppModule } from './app.module'; | |
| platformBrowserDynamic().bootstrapModule(AppModule); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "angular2-quickstart", | |
| "version": "1.0.0", | |
| "scripts": { | |
| "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", | |
| "lite": "lite-server", | |
| "postinstall": "typings install", | |
| "tsc": "tsc", | |
| "tsc:w": "tsc -w", | |
| "typings": "typings" | |
| }, | |
| "license": "ISC", | |
| "dependencies": { | |
| "@angular/common": "2.0.0-rc.5", | |
| "@angular/compiler": "2.0.0-rc.5", | |
| "@angular/core": "2.0.0-rc.5", | |
| "@angular/forms": "0.3.0", | |
| "@angular/http": "2.0.0-rc.5", | |
| "@angular/platform-browser": "2.0.0-rc.5", | |
| "@angular/platform-browser-dynamic": "2.0.0-rc.5", | |
| "@angular/router": "3.0.0-rc.1", | |
| "@angular/router-deprecated": "2.0.0-rc.2", | |
| "@angular/upgrade": "2.0.0-rc.5", | |
| "systemjs": "0.19.27", | |
| "core-js": "^2.4.0", | |
| "reflect-metadata": "^0.1.3", | |
| "rxjs": "5.0.0-beta.6", | |
| "zone.js": "^0.6.12", | |
| "angular2-in-memory-web-api": "0.0.15", | |
| "bootstrap": "^3.3.6" | |
| }, | |
| "devDependencies": { | |
| "concurrently": "^2.0.0", | |
| "lite-server": "^2.2.0", | |
| "typescript": "^1.8.10", | |
| "typings":"^1.0.4" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| padding: 50px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * System configuration for Angular 2 samples | |
| * Adjust as necessary for your application needs. | |
| */ | |
| (function(global) { | |
| // map tells the System loader where to look for things | |
| var map = { | |
| 'app': 'app', // 'dist', | |
| '@angular': 'node_modules/@angular', | |
| 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', | |
| 'rxjs': 'node_modules/rxjs' | |
| }; | |
| // packages tells the System loader how to load when no filename and/or no extension | |
| var packages = { | |
| 'app': { main: 'main.js', defaultExtension: 'js' }, | |
| 'rxjs': { defaultExtension: 'js' }, | |
| 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, | |
| }; | |
| var ngPackageNames = [ | |
| 'common', | |
| 'compiler', | |
| 'core', | |
| 'forms', | |
| 'http', | |
| 'platform-browser', | |
| 'platform-browser-dynamic', | |
| 'router', | |
| 'router-deprecated', | |
| 'upgrade', | |
| ]; | |
| // Individual files (~300 requests): | |
| function packIndex(pkgName) { | |
| packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; | |
| } | |
| // Bundled (~40 requests): | |
| function packUmd(pkgName) { | |
| packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' }; | |
| } | |
| // Most environments should use UMD; some (Karma) need the individual index files | |
| var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; | |
| // Add package entries for angular packages | |
| ngPackageNames.forEach(setPackageConfig); | |
| var config = { | |
| map: map, | |
| packages: packages | |
| }; | |
| System.config(config); | |
| })(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "compilerOptions": { | |
| "target": "es5", | |
| "module": "commonjs", | |
| "moduleResolution": "node", | |
| "sourceMap": true, | |
| "emitDecoratorMetadata": true, | |
| "experimentalDecorators": true, | |
| "removeComments": false, | |
| "noImplicitAny": false | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "globalDependencies": { | |
| "core-js": "registry:dt/core-js#0.0.0+20160602141332", | |
| "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", | |
| "node": "registry:dt/node#6.0.0+20160807145350" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment