refactor(Location): out of router and into platform/common

closes https://github.com/angular/angular/issues/4943

BREAKING CHANGE:

`Location` and other related providers have been moved out of `router` and into `platform/common`. `BrowserPlatformLocation` is not meant to be used directly however advanced configurations may use it via the following import change.

Before:

```
import {
  PlatformLocation,
  Location,
  LocationStrategy,
  HashLocationStrategy,
  PathLocationStrategy,
  APP_BASE_HREF}
from 'angular2/router';

import {BrowserPlatformLocation} from 'angular2/src/router/location/browser_platform_location';
```

After:

```
import {
  PlatformLocation,
  Location,
  LocationStrategy,
  HashLocationStrategy,
  PathLocationStrategy,
  APP_BASE_HREF}
from 'angular2/platform/common';

import {BrowserPlatformLocation} from 'angular2/src/platform/browser/location/browser_platform_location';
```

Closes #7962
This commit is contained in:
Nathan Walker
2016-04-08 00:31:20 -07:00
parent 30c43521d3
commit b602bd8c83
55 changed files with 187 additions and 178 deletions

View File

@ -14,9 +14,7 @@ import {
import {Injector, provide} from 'angular2/core';
import {PlatformLocation} from 'angular2/src/router/location/platform_location';
import {APP_BASE_HREF} from 'angular2/src/router/location/location_strategy';
import {HashLocationStrategy} from 'angular2/src/router/location/hash_location_strategy';
import {PlatformLocation, APP_BASE_HREF, HashLocationStrategy} from 'angular2/platform/common';
import {SpyPlatformLocation} from '../spies';
export function main() {

View File

@ -15,8 +15,7 @@ import {
import {Injector, provide} from 'angular2/core';
import {CONST_EXPR} from 'angular2/src/facade/lang';
import {Location} from 'angular2/src/router/location/location';
import {LocationStrategy, APP_BASE_HREF} from 'angular2/src/router/location/location_strategy';
import {Location, LocationStrategy, APP_BASE_HREF} from 'angular2/platform/common';
import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
export function main() {

View File

@ -15,9 +15,12 @@ import {
import {Injector, provide} from 'angular2/core';
import {CONST_EXPR} from 'angular2/src/facade/lang';
import {PlatformLocation} from 'angular2/src/router/location/platform_location';
import {LocationStrategy, APP_BASE_HREF} from 'angular2/src/router/location/location_strategy';
import {PathLocationStrategy} from 'angular2/src/router/location/path_location_strategy';
import {
PlatformLocation,
LocationStrategy,
PathLocationStrategy,
APP_BASE_HREF
} from 'angular2/platform/common';
import {SpyPlatformLocation} from '../spies';
export function main() {