New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alt. Router Initial Work #8173

Closed
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
6 participants
@vsavkin
Contributor

vsavkin commented Apr 21, 2016

No description provided.

export function main() {
describe('url parsing', () => {
let parser = new DefaultRouterUrlParser();

This comment has been minimized.

@vsavkin

vsavkin Apr 21, 2016

Contributor

UrlMarshaller? UrlSerializer/UrlDeserializer?

}
export class RouteSegment {
constructor(public urlSegments: UrlSegment[], public parameters: {[key: string]: string},

This comment has been minimized.

@vsavkin

vsavkin Apr 21, 2016

Contributor

Add the router field

abstract registerOutlet(name: string, outlet: RouterOutlet): void;
}
export class RootRouter extends Router {

This comment has been minimized.

@vsavkin

vsavkin Apr 21, 2016

Contributor

Rename into Router

registerOutlet(name: string, outlet: RouterOutlet): void { this._outlets[name] = outlet; }
}
export class ChildRouter extends Router {

This comment has been minimized.

@vsavkin

vsavkin Apr 21, 2016

Contributor

Call it RouterOutletMap?

@googlebot googlebot added the cla: yes label Apr 21, 2016

import {reflector} from 'angular2/src/core/reflection/reflection';
export function recognize(componentResolver: ComponentResolver, type: Type,
url: TreeNode<UrlSegment>): Promise<TreeNode<RouteSegment>> {

This comment has been minimized.

@vsavkin

vsavkin Apr 21, 2016

Contributor

Tree

registerOutlet(name: string, outlet: RouterOutlet): void { this._outlets[name] = outlet; }
}
export class Router extends RouterOutletMap {

This comment has been minimized.

@vsavkin

vsavkin Apr 21, 2016

Contributor

Make it contain an outlet map

return index > -1 && index < this._nodes.length - 1 ? this._nodes[index + 1] : null;
}
pathToRoot(t: T): T[] {

This comment has been minimized.

@vsavkin

vsavkin Apr 22, 2016

Contributor

rename into pathFromRoot

@vsavkin

This comment has been minimized.

Contributor

vsavkin commented Apr 22, 2016

Did a walkthrough with Misko

return new Tree<UrlSegment>(this._parseNodes(url));
}
private _parseNodes(url: string): UrlSegment[] {

This comment has been minimized.

@gkalpak

gkalpak Apr 23, 2016

Member

Isn't this method essentially doing url.split('/').map(segment => new UrlSegment(segment, {}, '')) ?

import {StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
import {Type, isBlank} from 'angular2/src/facade/lang';
export class Tree<T> {

This comment has been minimized.

@gkalpak

gkalpak Apr 23, 2016

Member

OOC, why is this called Tree. Are there any plans to allow multiple children in the future ?

@mary-poppins

This comment has been minimized.

mary-poppins commented Apr 25, 2016

Merging PR #8173 on behalf of @rkirov to branch presubmit-rkirov-pr-8173.

@rkirov

This comment has been minimized.

Contributor

rkirov commented Apr 25, 2016

depends on tobias' changes so this is skipping g3_v2_0 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment