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
2016-04-08 03:31:20 -04:00
|
|
|
import {Location} from 'angular2/platform/common';
|
|
|
|
import {Router, RouterOutlet} from 'angular2/router';
|
2015-10-13 03:29:13 -04:00
|
|
|
import {SpyObject, proxy} from 'angular2/testing_internal';
|
2015-08-26 14:41:41 -04:00
|
|
|
|
|
|
|
export class SpyRouter extends SpyObject {
|
|
|
|
constructor() { super(Router); }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SpyRouterOutlet extends SpyObject {
|
|
|
|
constructor() { super(RouterOutlet); }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SpyLocation extends SpyObject {
|
|
|
|
constructor() { super(Location); }
|
2015-11-23 13:47:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export class SpyPlatformLocation extends SpyObject {
|
|
|
|
pathname: string = null;
|
2016-02-25 19:18:55 -05:00
|
|
|
search: string = null;
|
|
|
|
hash: string = null;
|
2015-11-23 13:47:06 -05:00
|
|
|
constructor() { super(SpyPlatformLocation); }
|
|
|
|
}
|