HTTP Client

Talk to a remote server with an HTTP Client. HTTP is the primary protocol for browser/server communication. The WebSocket protocol is another important communication technology; we won't cover it in this chapter. Modern browsers support two HTTP-based APIs: XMLHttpRequest (XHR) and JSONP. A few browsers also support Fetch. The Angular HTTP library simplifies application programming of the XHR and JSONP APIs as we'll learn in this chapter covering: HTTP client sample overview Fetch data with

6. Routing

We add the Angular Component Router and learn to navigate among the views Routing Around the App We received new requirements for our Tour of Heroes application: Add a Dashboard view. Navigate between the Heroes and Dashboard views. Clicking on a hero in either view navigates to a detail view of the selected hero. Clicking a deep link in an email opens the detail view for a particular hero. When we’re done, users will be able to navigate the app like this: We'll add Angular’s Component Rout

TrackByFn

Stable Interface Interface Overview interface TrackByFn { } Interface Description An optional function passed into NgFor that defines how to track items in an iterable (e.g. by index or id) exported from @angular/core/index, defined in @angular/core/src/change_detection/differs/iterable_differs.ts

disableDebugTools()

Experimental Function Class Export export disableDebugTools() : void Disables Angular 2 tools. exported from @angular/platform-browser/index defined in @angular/platform-browser/src/browser/tools/tools.ts

UpgradeAdapterRef

Stable Class Class Overview class UpgradeAdapterRef { ng1RootScope : IRootScopeService ng1Injector : IInjectorService ng2ModuleRef : NgModuleRef<any> ng2Injector : Injector ready(fn: (upgradeAdapterRef?: UpgradeAdapterRef) => void) dispose() } Class Description Use UpgradeAdapterRef to control a hybrid AngularJS v1 / Angular v2 application. Class Details ng1RootScope : IRootScopeService ng1Injector : IInjectorService ng2ModuleRef : NgModuleRef<any> ng2Inject

UrlSerializer

Stable Class What it does Serializes and deserializes a URL string into a URL tree. Class Overview class UrlSerializer { parse(url: string) : UrlTree serialize(tree: UrlTree) : string } Class Description The url serialization strategy is customizable. You can make all URLs case insensitive by providing a custom UrlSerializer. See DefaultUrlSerializer for an example of a URL serializer. Class Details parse(url: string) : UrlTree Parse a url into a UrlTree. serialize(tree: UrlTree)

RequiredValidator

Stable Directive Class Overview class RequiredValidator { required : boolean validate(c: AbstractControl) : {[key: string]: any} registerOnValidatorChange(fn: () => void) } Selectors [required][formControlName] [required][formControl] [required][ngModel] Class Description A Directive that adds the required validator to any controls marked with the required attribute, via the NG_VALIDATORS binding. Example <input name="fullName" ngModel required> Class Details required :

group()

Experimental Function Class Export export group(steps: AnimationMetadata[]) : AnimationGroupMetadata group is an animation-specific function that is designed to be used inside of Angular2's animation DSL language. If this information is new, please navigate to the component animations metadata page to gain a better understanding of how animations in Angular2 are used. group specifies a list of animation steps that are all run in parallel. Grouped animations are useful when a series of styles

AsyncValidatorFn

Stable Interface Interface Overview interface AsyncValidatorFn { } Interface Description exported from @angular/forms/index, defined in @angular/forms/src/directives/validators.ts

RequestOptions

Experimental Class Class Overview class RequestOptions { constructor({method, headers, body, url, search, withCredentials, responseType}?: RequestOptionsArgs) method : RequestMethod|string headers : Headers body : any url : string search : URLSearchParams withCredentials : boolean responseType : ResponseContentType merge(options?: RequestOptionsArgs) : RequestOptions } Class Description Creates a request options object to be optionally provided when instantia