feat(router): add regex matchers
@petebacondarwin deserves credit for most of this commit.
This allows you to specify a regex and serializer function instead
of the path DSL in your route declaration.
```
@RouteConfig([
{ regex: '[a-z]+.[0-9]+',
serializer: (params) => `{params.a}.params.b}`,
component: MyComponent }
])
class Component {}
```
Closes #7325
Closes #7126
This commit is contained in:
committed by
Vikram Subramanian
parent
2548ce86db
commit
75343eb340
@@ -1,4 +1,4 @@
|
||||
import {BrowserPlatformLocation} from 'angular2/src/router/browser_platform_location';
|
||||
import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
|
||||
import {Injectable} from 'angular2/src/core/di';
|
||||
import {ROUTER_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {
|
||||
@@ -10,7 +10,7 @@ import {bind} from './bind';
|
||||
import {LocationType} from 'angular2/src/web_workers/shared/serialized_types';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {EventEmitter, ObservableWrapper, PromiseWrapper} from 'angular2/src/facade/async';
|
||||
import {UrlChangeListener} from 'angular2/src/router/platform_location';
|
||||
import {UrlChangeListener} from 'angular2/src/router/location/platform_location';
|
||||
|
||||
@Injectable()
|
||||
export class MessageBasedPlatformLocation {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {MessageBasedPlatformLocation} from './platform_location';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {BrowserPlatformLocation} from 'angular2/src/router/browser_platform_location';
|
||||
import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
|
||||
import {APP_INITIALIZER, Provider, Injector, NgZone} from 'angular2/core';
|
||||
|
||||
export const WORKER_RENDER_ROUTER = CONST_EXPR([
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
PlatformLocation,
|
||||
UrlChangeEvent,
|
||||
UrlChangeListener
|
||||
} from 'angular2/src/router/platform_location';
|
||||
} from 'angular2/src/router/location/platform_location';
|
||||
import {
|
||||
FnArg,
|
||||
UiArguments,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {ApplicationRef, Provider, NgZone, APP_INITIALIZER} from 'angular2/core';
|
||||
import {PlatformLocation} from 'angular2/src/router/platform_location';
|
||||
import {PlatformLocation} from 'angular2/src/router/location/platform_location';
|
||||
import {WebWorkerPlatformLocation} from './platform_location';
|
||||
import {ROUTER_PROVIDERS_COMMON} from 'angular2/src/router/router_providers_common';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user