plugins for vs code angular2 are available there is a bootstrap() function for bootstrapping the application (replacement for ngApp)
angular cookbook tests http://pepa.holla.cz/wp-content/uploads/2015/10/AngularJS-Testing-Cookbook.pdf
angular cli http://cli.angular.io
npm install -g angular-cli ng new mydreamapp ng serve
http://jpapa.me/ng2styleguide npm install --save-dev codelyzer
// story.components.ts
// modules import { Component, OnInit } from ' @angular/core'; import { Http, Response } from '@angular/http' ; import { SessionService } from './shared/session.service';
// components @Component({ slector: ' my-store', templateUrl: ' app/story.component.html', providers: [SessionService] })
export class StoryComponent implements OnInit { name = 'Han Solo';
constructor(private sessionService: SessionService) { }
ngOnInit() {
this.sessionService.getSessions()
.subscribe(s => this.sessions = s);
}
}
// story.component.html
// works for any HTML attribute!:
<img [src]="vehicle.imageUrl">
<div [class.isStopped]="isStopped">Stopped</div>
// event binding
// work for any DOM event!
<button (click)="save()">Save</button>
// two way binding
// football in a box / banana in a box
<input [(ngModel)]="vehicle.name">
// vehicle.service.ts @Injectable() export class VehicleService { getVehicles() { return [ new Vehicle(10 'X-Wing Fighter') ]; } }
Modules (ES6 Modules voor dependency management / requirejs vervanging) Components Templates Structural directives Data binding Services - class Dependency injection
vs code is geschreven in electron: http://electron.atom.io angular2 digest is veel sneller angular2 is nu 45kb use kebab-case for html elements