ValidatorFn

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

Validator

Stable Interface Interface Overview interface Validator { validate(c: AbstractControl) : {[key: string]: any} registerOnValidatorChange(fn: () => void) : void } Interface Description An interface that can be implemented by classes that can act as validators. Usage @Directive({ selector: '[custom-validator]', providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}] }) class CustomValidatorDirective implements Validator { validate(c: Control): {[

UrlTree

Stable Interface What it does Represents the parsed URL. How to use @Component({templateUrl:'template.html'}) class MyComponent { constructor(router: Router) { const tree: UrlTree = router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment'); const f = tree.fragment; // return 'fragment' const q = tree.queryParams; // returns {debug: 'true'} const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET]; const s: UrlSegment[] = g.segments; // returns 2

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)

UrlSegment

Stable Class What it does Represents a single URL segment. How to use @Component({templateUrl:'template.html'}) class MyComponent { constructor(router: Router) { const tree: UrlTree = router.parseUrl('/team;id=33'); const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET]; const s: UrlSegment[] = g.segments; s[0].path; // returns 'team' s[0].parameters; // returns {id: 33} } } Class Overview class UrlSegment { constructor(path: string, parameters: {[key: s

URLSearchParams

Experimental Class Class Overview class URLSearchParams { constructor(rawParams?: string, queryEncoder?: QueryEncoder) paramsMap : Map<string, string[]> rawParams : string clone() : URLSearchParams has(param: string) : boolean get(param: string) : string getAll(param: string) : string[] set(param: string, val: string) setAll(searchParams: URLSearchParams) append(param: string, val: string) : void appendAll(searchParams: URLSearchParams) replaceAll(searchPa

UpperCasePipe

Stable Pipe What it does Transforms string to uppercase. How to use expression | uppercase NgModuleCommonModule Description Converts value into lowercase string using String.prototype.toUpperCase(). Example @Component({ selector: 'lowerupper-pipe', template: `<div> <label>Name: </label><input #name (keyup)="change(name.value)" type="text"> <p>In lowercase: <pre>'{{value | lowercase}}'</pre> <p>In uppercase: <pre>'{{v

Upgrading from 1.x

Angular 1 applications can be incrementally upgraded to Angular 2. This guide is still in the process of being updated to RC5 and it's samples may not work correctly. Having an existing Angular 1 application doesn't mean that we can't begin enjoying everything Angular 2 has to offer. That's because Angular 2 comes with built-in tools for migrating Angular 1 projects over to the Angular 2 platform. Some applications will be easier to upgrade than others, and there are ways in which we can make

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

UpgradeAdapter

Stable Class Class Overview class UpgradeAdapter { constructor(ng2AppModule: Type<any>) downgradeNg2Component(type: Type<any>) : Function upgradeNg1Component(name: string) : Type<any> bootstrap(element: Element, modules?: any[], config?:IAngularBootstrapConfig) : UpgradeAdapterRef upgradeNg1Provider(name: string, options?: {asToken: any}) downgradeNg2Provider(token: any) : Function } Class Description Use UpgradeAdapter to allow AngularJS v1 and Angular