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

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)

ValidatorFn

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

Validators

Stable Class Class Overview class Validators { staticrequired(control: AbstractControl) : {[key: string]: boolean} staticminLength(minLength: number) : ValidatorFn staticmaxLength(maxLength: number) : ValidatorFn staticpattern(pattern: string) : ValidatorFn staticnullValidator(c: AbstractControl) : {[key: string]: boolean} staticcompose(validators: ValidatorFn[]) : ValidatorFn staticcomposeAsync(validators: AsyncValidatorFn[]) : AsyncValidatorFn } Class Description Provides a

ValueProvider

Stable Interface What it does Configures the Injector to return a value for a token. How to use const provider: ValueProvider = {provide: 'someToken', useValue: 'someValue'}; Interface Overview interface ValueProvider { provide : any useValue : any multi : boolean } Interface Description For more details, see the Dependency Injection Guide. Example const injector = ReflectiveInjector.resolveAndCreate([{provide: String, useValue: 'Hello'}]); expect(injector.get(String)).toEq

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

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

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

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