1. Introduction

The Tour of Heroes tutorial takes us through the steps of creating an Angular application in TypeScript. Tour of Heroes: the vision Our grand plan is to build an app to help a staffing agency manage its stable of heroes. Even heroes need to find work. Of course we'll only make a little progress in this tutorial. What we do build will have many of the features we expect to find in a full-blown, data-driven application: acquiring and displaying a list of heroes, editing a selected hero's detail,

JsonpModule

Experimental Class Class Overview class JsonpModule { } Class Description The module that includes jsonp's providers Annotations @NgModule({ providers: [ // TODO(pascal): use factory type annotations once supported in DI // issue: https://github.com/angular/angular/issues/3183 {provide: Jsonp, useFactory: jsonpFactory, deps: [JSONPBackend, RequestOptions]}, BrowserJsonp, {provide: RequestOptions, useClass: BaseRequestOptions}, {provide: ResponseOptions, useClass

common

Module Entry point for all public APIs of the common package. APP_BASE_HREF AsyncPipe CommonModule CurrencyPipe DatePipe DecimalPipe HashLocationStrategy I18nPluralPipe I18nSelectPipe JsonPipe Location LocationChangeEvent LocationChangeListener LocationStrategy LowerCasePipe NgClass NgFor NgIf NgLocalization NgPlural NgPluralCase NgStyle NgSwitch NgSwitchCase NgSwitchDefault NgTemplateOutlet PathLocationStrategy PercentPipe PlatformLocation SlicePipe UpperCasePipe defined in @angular/common/i

OpaqueToken

Stable Class Class Overview class OpaqueToken { constructor(_desc: string) toString() : string } Class Description Creates a token that can be used in a DI Provider. Example (live demo) var t = new OpaqueToken("value"); var injector = Injector.resolveAndCreate([ {provide: t, useValue: "bindingValue"} ]); expect(injector.get(t)).toEqual("bindingValue"); Using an OpaqueToken is preferable to using strings as tokens because of possible collisions caused by multiple providers us

CanActivateChild

Stable Interface What it does Indicates that a class can implement to be a guard deciding if a child route can be activated. How to use class UserToken {} class Permissions { canActivate(user: UserToken, id: string): boolean { return true; } } @Injectable() class CanActivateTeam implements CanActivate { constructor(private permissions: Permissions, private currentUser: UserToken) {} canActivateChild( route: ActivatedRouteSnapshot, state: RouterStateSnapshot ): Obser

ClientMessageBroker

Experimental Class Class Overview class ClientMessageBroker { runOnService(args: UiArguments, returnType: Type<any>) : Promise<any> } Class Description Class Details runOnService(args: UiArguments, returnType: Type<any>) : Promise<any> exported from @angular/platform-webworker/index, defined in @angular/platform-webworker/src/web_workers/shared/client_message_broker.ts

async()

Stable Function Class Export export async(fn: Function) : (done: any) => any Wraps a test function in an asynchronous test zone. The test will automatically complete when all asynchronous calls within this zone are done. Can be used to wrap an inject call. Example: it('...', async(inject([AClass], (object) => { object.doSomething.then(() => { expect(...); }) }); exported from @angular/core/testing/index defined in @angular/core/testing/async.ts

Attribute

Stable Interface Interface Overview interface Attribute { attributeName : string } Interface Description Attribute decorator and metadata. Interface Details attributeName : string exported from @angular/core/index, defined in @angular/core/src/metadata/di.ts

WORKER_UI_LOCATION_PROVIDERS

Experimental Const Variable Export export WORKER_UI_LOCATION_PROVIDERS A list of Providers. To use the router in a Worker enabled application you must include these providers when setting up the render thread. exported from @angular/platform-webworker/index defined in @angular/platform-webworker/src/web_workers/ui/location_providers.ts

NgControlStatus

Stable Directive Class Overview class NgControlStatus { constructor(cd: NgControl) } Selectors [formControlName] [ngModel] [formControl] Class Description Directive automatically applied to Angular form controls that sets CSS classes based on control status (valid/invalid/dirty/etc). Constructor constructor(cd: NgControl) exported from @angular/forms/index, defined in @angular/forms/src/directives/ng_control_status.ts