Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
149a704
fix(angular1_router): rename `router` component binding to `$router`
petebacondarwin Feb 11, 2016
d23ecd8
fix(angular1_router): support templateUrl components
petebacondarwin Feb 11, 2016
fea4518
fix(angular1_router): rename `router` component binding to `$router`
petebacondarwin Feb 11, 2016
47d5444
wip: feat(router): add regex matchers
btford Feb 9, 2016
40f5b9f
test(router): fix expected regex error message
petebacondarwin Feb 14, 2016
6bcec5c
refactor(router): rename ComponentRecognizer -> RuleSet
petebacondarwin Feb 14, 2016
00c4ec7
refactor(router): rename route "...Recognizer" classes to "...Rule"
petebacondarwin Feb 14, 2016
27b3348
refactor(router): DefaultInstruction can inherit from ResolvedInstruc…
petebacondarwin Feb 14, 2016
8fb31f2
refactor(router): move route handlers into their own folder
petebacondarwin Feb 14, 2016
8a34576
refactor(router): move location classes into location folder
petebacondarwin Feb 14, 2016
8f98490
refactor(router): move rules into their own folder
petebacondarwin Feb 15, 2016
18c1857
refactor(router): move recognizers into their own folder
petebacondarwin Feb 15, 2016
c8898af
refactor(router): move lifecycle stuff into its own folder
petebacondarwin Feb 15, 2016
d94dc88
refactor(router): move route config stuff into its own folder
petebacondarwin Feb 15, 2016
4039b8f
refactor(router): move recognizers into the rules folder
petebacondarwin Feb 15, 2016
785df61
refactor(router): move directives into their own folder
petebacondarwin Feb 15, 2016
e523f7b
refactor(router): move urlParser into the rules folder
petebacondarwin Feb 15, 2016
76922f8
refactor(router): change `Recognizer`s -> `PathRoute` and associated …
petebacondarwin Feb 17, 2016
16340f3
style(router): fix formatting
petebacondarwin Feb 17, 2016
2ce29ab
refactor(router): move route_handlers into rules folder
petebacondarwin Feb 17, 2016
30b36ee
refactor(router): move location specs into their own folder
petebacondarwin Feb 17, 2016
0d7595f
refactor(router): move rule tests into their own folder
petebacondarwin Feb 17, 2016
6e50b08
refactor(router): move directive tests into their own folder
petebacondarwin Feb 17, 2016
89e0258
refactor(router): move router config tests into their own folder
petebacondarwin Feb 17, 2016
e72f142
refactor(router): move urlParser back up to router folder
petebacondarwin Feb 17, 2016
b998956
refactor(router): move routePath stuff in its own subfolder
petebacondarwin Feb 17, 2016
d7946ff
refactor(router): move route_handlers into rules folder
petebacondarwin Feb 17, 2016
6501517
refactor(router): move directive tests into their own folder
petebacondarwin Feb 17, 2016
7fdf52c
refactor(router): pass route_paths to rule constructors
petebacondarwin Feb 17, 2016
3407f48
refactor(router): remove unnecessary properties
petebacondarwin Feb 17, 2016
45416e3
style(router): move private method to bottom of class
petebacondarwin Feb 17, 2016
138839c
refactor(router): remove unnecessary properties
petebacondarwin Feb 17, 2016
404b4f4
feat(router): add support for regular expression route paths
petebacondarwin Feb 17, 2016
17fee3d
refactor(router): rename route "...Recognizer" classes to "...Rule"
petebacondarwin Feb 24, 2016
5b5f613
refactor(router): change `Recognizer`s -> `PathRoute` and associated …
petebacondarwin Feb 24, 2016
0a50039
refactor(router): make UrlParams more explicit
petebacondarwin Feb 24, 2016
cf5469a
refactor(router): fix un-dartable code
petebacondarwin Feb 25, 2016
002d4bf
chore(angular_1_router): fix build to account for file refactoring
petebacondarwin Feb 26, 2016
b17d44d
style(router): fix formatting errors
petebacondarwin Feb 26, 2016
a3ee427
test(router): relax regex error message
petebacondarwin Feb 26, 2016
070c36f
fix(router): handle trying to serialize non-existent urlParams
petebacondarwin Feb 26, 2016
26cf715
refactor(router): fix un-dartable code
petebacondarwin Feb 26, 2016
411cfb7
chore(node_tree): fix path to excluded router test
petebacondarwin Feb 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions modules/angular1_router/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ var fs = require('fs');
var ts = require('typescript');

var files = [
'lifecycle_annotations_impl.ts',
'utils.ts',
'url_parser.ts',
'route_recognizer.ts',
'route_config_impl.ts',
'async_route_handler.ts',
'sync_route_handler.ts',
'component_recognizer.ts',
'lifecycle/lifecycle_annotations_impl.ts',
'lifecycle/route_lifecycle_reflector.ts',
'route_config/route_config_impl.ts',
'route_config/route_config_normalizer.ts',
'rules/route_handlers/async_route_handler.ts',
'rules/route_handlers/sync_route_handler.ts',
'rules/rules.ts',
'rules/rule_set.ts',
'rules/route_paths/route_path.ts',
'rules/route_paths/param_route_path.ts',
'rules/route_paths/regex_route_path.ts',
'instruction.ts',
'path_recognizer.ts',
'route_config_nomalizer.ts',
'route_lifecycle_reflector.ts',
'route_registry.ts',
'router.ts'
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ describe('Navigation lifecycle', function () {

expect(spy).toHaveBeenCalled();
var args = spy.calls.mostRecent().args;
expect(args[0].params).toEqual({name: 'brian'});
expect(args[0].params).toEqual(jasmine.objectContaining({name: 'brian'}));
expect(args[1]).toBe($http);
}));

Expand Down
8 changes: 2 additions & 6 deletions modules/angular1_router/test/integration/router_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,8 @@ describe('router', function () {
bindings: options.bindings,
controller: getController(options),
};
if (options.template) {
definition.template = options.template;
}
if (options.templateUrl) {
definition.templateUrl = options.templateUrl;
}
if (options.template) definition.template = options.template;
if (options.templateUrl) definition.templateUrl = options.templateUrl;

applyStaticProperties(definition, options);
$compileProvider.component(name, definition);
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/platform/testing/browser_static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {MockAnimationBuilder} from 'angular2/src/mock/animation_builder_mock';
import {MockDirectiveResolver} from 'angular2/src/mock/directive_resolver_mock';
import {MockViewResolver} from 'angular2/src/mock/view_resolver_mock';
import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
import {LocationStrategy} from 'angular2/src/router/location_strategy';
import {LocationStrategy} from 'angular2/src/router/location/location_strategy';
import {MockNgZone} from 'angular2/src/mock/ng_zone_mock';

import {XHRImpl} from "angular2/src/platform/browser/xhr_impl";
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/platform/testing/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {MockAnimationBuilder} from 'angular2/src/mock/animation_builder_mock';
import {MockDirectiveResolver} from 'angular2/src/mock/directive_resolver_mock';
import {MockViewResolver} from 'angular2/src/mock/view_resolver_mock';
import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
import {LocationStrategy} from 'angular2/src/router/location_strategy';
import {LocationStrategy} from 'angular2/src/router/location/location_strategy';
import {MockNgZone} from 'angular2/src/mock/ng_zone_mock';

import {TestComponentBuilder} from 'angular2/src/testing/test_component_builder';
Expand Down
22 changes: 11 additions & 11 deletions modules/angular2/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
*/

export {Router} from './src/router/router';
export {RouterOutlet} from './src/router/router_outlet';
export {RouterLink} from './src/router/router_link';
export {RouterOutlet} from './src/router/directives/router_outlet';
export {RouterLink} from './src/router/directives/router_link';
export {RouteParams, RouteData} from './src/router/instruction';
export {PlatformLocation} from './src/router/platform_location';
export {PlatformLocation} from './src/router/location/platform_location';
export {RouteRegistry, ROUTER_PRIMARY_COMPONENT} from './src/router/route_registry';
export {LocationStrategy, APP_BASE_HREF} from './src/router/location_strategy';
export {HashLocationStrategy} from './src/router/hash_location_strategy';
export {PathLocationStrategy} from './src/router/path_location_strategy';
export {Location} from './src/router/location';
export * from './src/router/route_config_decorator';
export {LocationStrategy, APP_BASE_HREF} from './src/router/location/location_strategy';
export {HashLocationStrategy} from './src/router/location/hash_location_strategy';
export {PathLocationStrategy} from './src/router/location/path_location_strategy';
export {Location} from './src/router/location/location';
export * from './src/router/route_config/route_config_decorator';
export * from './src/router/route_definition';
export {OnActivate, OnDeactivate, OnReuse, CanDeactivate, CanReuse} from './src/router/interfaces';
export {CanActivate} from './src/router/lifecycle_annotations';
export {CanActivate} from './src/router/lifecycle/lifecycle_annotations';
export {Instruction, ComponentInstruction} from './src/router/instruction';
export {OpaqueToken} from 'angular2/core';
export {ROUTER_PROVIDERS_COMMON} from 'angular2/src/router/router_providers_common';
export {ROUTER_PROVIDERS, ROUTER_BINDINGS} from 'angular2/src/router/router_providers';

import {RouterOutlet} from './src/router/router_outlet';
import {RouterLink} from './src/router/router_link';
import {RouterOutlet} from './src/router/directives/router_outlet';
import {RouterLink} from './src/router/directives/router_link';
import {CONST_EXPR} from './src/facade/lang';

/**
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/router/router_link_dsl.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {TEMPLATE_TRANSFORMS} from 'angular2/compiler';
import {Provider} from 'angular2/core';
import {RouterLinkTransform} from 'angular2/src/router/router_link_transform';
import {RouterLinkTransform} from 'angular2/src/router/directives/router_link_transform';
import {CONST_EXPR} from 'angular2/src/facade/lang';

export {RouterLinkTransform} from 'angular2/src/router/router_link_transform';
export {RouterLinkTransform} from 'angular2/src/router/directives/router_link_transform';

/**
* Enables the router link DSL.
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/mock/location_mock.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Injectable} from 'angular2/src/core/di';
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {ListWrapper} from 'angular2/src/facade/collection';
import {Location} from 'angular2/src/router/location';
import {Location} from 'angular2/src/router/location/location';

/**
* A spy for {@link Location} that allows tests to fire simulated location events.
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/mock/mock_location_strategy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Injectable} from 'angular2/src/core/di';
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
import {LocationStrategy} from 'angular2/src/router/location_strategy';
import {LocationStrategy} from 'angular2/src/router/location/location_strategy';


/**
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/platform/worker_render_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {BrowserDomAdapter} from './browser/browser_adapter';
import {wtfInit} from 'angular2/src/core/profile/wtf_init';
import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer';
import {MessageBasedXHRImpl} from 'angular2/src/web_workers/ui/xhr_impl';
import {BrowserPlatformLocation} from 'angular2/src/router/browser_platform_location';
import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
import {
ServiceMessageBrokerFactory,
ServiceMessageBrokerFactory_
Expand Down
163 changes: 0 additions & 163 deletions modules/angular2/src/router/component_recognizer.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {Directive} from 'angular2/core';
import {isString} from 'angular2/src/facade/lang';

import {Router} from './router';
import {Location} from './location';
import {Instruction} from './instruction';
import {Router} from '../router';
import {Location} from '../location/location';
import {Instruction} from '../instruction';

/**
* The RouterLink directive lets you link to specific parts of your app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {
Dependency
} from 'angular2/core';

import * as routerMod from './router';
import {ComponentInstruction, RouteParams, RouteData} from './instruction';
import * as hookMod from './lifecycle_annotations';
import {hasLifecycleHook} from './route_lifecycle_reflector';
import {OnActivate, CanReuse, OnReuse, OnDeactivate, CanDeactivate} from './interfaces';
import * as routerMod from '../router';
import {ComponentInstruction, RouteParams, RouteData} from '../instruction';
import * as hookMod from '../lifecycle/lifecycle_annotations';
import {hasLifecycleHook} from '../lifecycle/route_lifecycle_reflector';
import {OnActivate, CanReuse, OnReuse, OnDeactivate, CanDeactivate} from '../interfaces';

let _resolveToTrue = PromiseWrapper.resolve(true);

Expand Down
12 changes: 5 additions & 7 deletions modules/angular2/src/router/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,11 @@ export class ResolvedInstruction extends Instruction {
/**
* Represents a resolved default route
*/
export class DefaultInstruction extends Instruction {
export class DefaultInstruction extends ResolvedInstruction {
constructor(component: ComponentInstruction, child: DefaultInstruction) {
super(component, child, {});
}

resolveComponent(): Promise<ComponentInstruction> {
return PromiseWrapper.resolve(this.component);
}

toLinkUrl(): string { return ''; }

/** @internal */
Expand Down Expand Up @@ -292,8 +288,7 @@ export class RedirectInstruction extends ResolvedInstruction {


/**
* A `ComponentInstruction` represents the route state for a single component. An `Instruction` is
* composed of a tree of these `ComponentInstruction`s.
* A `ComponentInstruction` represents the route state for a single component.
*
* `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed
* to route lifecycle hooks, like {@link CanActivate}.
Expand All @@ -308,6 +303,9 @@ export class ComponentInstruction {
reuse: boolean = false;
public routeData: RouteData;

/**
* @internal
*/
constructor(public urlPath: string, public urlParams: string[], data: RouteData,
public componentType, public terminal: boolean, public specificity: string,
public params: {[key: string]: any} = null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import {makeDecorator} from 'angular2/src/core/util/decorators';
import {CanActivate as CanActivateAnnotation} from './lifecycle_annotations_impl';
import {ComponentInstruction} from './instruction';
import {ComponentInstruction} from '../instruction';

export {
routerCanReuse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library angular.router.route_lifecycle_reflector;

import 'package:angular2/src/router/lifecycle_annotations_impl.dart';
import 'package:angular2/src/router/lifecycle/lifecycle_annotations_impl.dart';
import 'package:angular2/src/router/interfaces.dart';
import 'package:angular2/src/core/reflection/reflection.dart';

Expand Down
Loading