angular-cn/modules/angular2/test/router
Brian Ford cf7292fcb1 refactor(router): improve recognition and generation pipeline
This is a big change. @matsko also deserves much of the credit for the implementation.

Previously, `ComponentInstruction`s held all the state for async components.
Now, we introduce several subclasses for `Instruction` to describe each type of navigation.

BREAKING CHANGE:

Redirects now use the Link DSL syntax. Before:

```
@RouteConfig([
  { path: '/foo', redirectTo: '/bar' },
  { path: '/bar', component: BarCmp }
])
```

After:

```
@RouteConfig([
  { path: '/foo', redirectTo: ['Bar'] },
  { path: '/bar', component: BarCmp, name: 'Bar' }
])
```

BREAKING CHANGE:

This also introduces `useAsDefault` in the RouteConfig, which makes cases like lazy-loading
and encapsulating large routes with sub-routes easier.

Previously, you could use `redirectTo` like this to expand a URL like `/tab` to `/tab/posts`:

@RouteConfig([
  { path: '/tab', redirectTo: '/tab/users' }
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

Now the recommended way to handle this is case is to use `useAsDefault` like so:

```
@RouteConfig([
  { path: '/tab', component: TabsCmp, name: 'Tab' }
])
AppCmp { ... }

@RouteConfig([
  { path: '/posts', component: PostsCmp, useAsDefault: true, name: 'Posts' },
  { path: '/users', component: UsersCmp, name: 'Users' }
])
TabsCmp { ... }
```

In the above example, you can write just `['/Tab']` and the route `Users` is automatically selected as a child route.

Closes #4170
Closes #4490
Closes #4694
Closes #5200

Closes #5352
2015-11-20 23:18:43 +00:00
..
integration refactor(router): improve recognition and generation pipeline 2015-11-20 23:18:43 +00:00
component_recognizer_spec.ts refactor(router): improve recognition and generation pipeline 2015-11-20 23:18:43 +00:00
location_spec.ts fix(router): apply APP_BASE_HREF when using PathLocationStrategy 2015-11-17 21:19:22 +00:00
path_recognizer_spec.ts refactor(router): improve recognition and generation pipeline 2015-11-20 23:18:43 +00:00
route_config_spec.dart style(dart): Run dartfmt v0.1.8+2 on all pure Dart code 2015-07-28 12:44:03 -07:00
route_config_spec.ts refactor(router): improve recognition and generation pipeline 2015-11-20 23:18:43 +00:00
route_registry_spec.ts refactor(router): improve recognition and generation pipeline 2015-11-20 23:18:43 +00:00
router_link_spec.ts refactor(router): improve recognition and generation pipeline 2015-11-20 23:18:43 +00:00
router_spec.ts refactor(router): improve recognition and generation pipeline 2015-11-20 23:18:43 +00:00
spies.dart refactor(test): rename test_lib to testing 2015-10-13 10:36:49 -07:00
spies.ts refactor(test): rename test_lib to testing 2015-10-13 10:36:49 -07:00
url_parser_spec.ts test(router): add missing tests for the url parser 2015-10-13 12:06:22 -07:00