Skip to content

Latest commit

 

History

History
78 lines (54 loc) · 1.31 KB

README.md

File metadata and controls

78 lines (54 loc) · 1.31 KB

Getting Started

  1. Must install pre-requisites npm install -g tsd typescript live-server

  2. Fork and cone this repo

  3. npm install

  4. Run the TypeScript compiler and watch for changes npm run tsc

  5. Open 2nd terminal and launch the app in the browser npm start

Notes

  • Add redirectTo and/or otherwise routes
  • Replace mocks with http when ready
  • /typings folder needs to be moved manually to the /src/typings folder
  • paths in the typings must be fixed too

From Scratch

  1. Create empty package.json

    npm init -y
  2. Install npm packages

    npm install --save angular2 systemjs traceur
  3. Make a source folder

    mkdir -p src/app
  4. Install typings files

    tsd install angular2 -rosa --config src/tsd.json
  5. Create a tsconfig.json file, in an editor

    {
    	"compilerOptions": {
    		"target": "ES5",
    		"module": "commonjs",
    		"sourceMap": true,
    		"emitDecoratorMetadata": true,
    		"experimentalDecorators": true,
    		"removeComments": false,
    		"noImplicitAny": true
    	}
    }
  6. Create app.ts and enter

    import {bootstrap, Component, View} from 'angular2/angular2';
    
    @Component({
    	selector: 'app'
    })
    @View({
    	template: '<h1>My First Angular 2 App</h1>'
    })
    export class AppComponent { }
    
    bootstrap(AppComponent);