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:
@ -1,12 +1,7 @@
|
||||
import {provide, Component} from 'angular2/core';
|
||||
import {bootstrap} from 'angular2/platform/browser';
|
||||
import {
|
||||
CanActivate,
|
||||
RouteConfig,
|
||||
ComponentInstruction,
|
||||
APP_BASE_HREF,
|
||||
ROUTER_DIRECTIVES
|
||||
} from 'angular2/router';
|
||||
import {CanActivate, RouteConfig, ComponentInstruction, ROUTER_DIRECTIVES} from 'angular2/router';
|
||||
import {APP_BASE_HREF} from 'angular2/platform/common';
|
||||
|
||||
function checkIfWeHavePermission(instruction: ComponentInstruction) {
|
||||
return instruction.params['id'] == '1';
|
||||
|
@ -5,9 +5,9 @@ import {
|
||||
RouteConfig,
|
||||
RouteParams,
|
||||
ComponentInstruction,
|
||||
ROUTER_DIRECTIVES,
|
||||
APP_BASE_HREF
|
||||
ROUTER_DIRECTIVES
|
||||
} from 'angular2/router';
|
||||
import {APP_BASE_HREF} from 'angular2/platform/common';
|
||||
|
||||
// #docregion routerCanDeactivate
|
||||
@Component({
|
||||
|
@ -1,12 +1,7 @@
|
||||
import {Component, provide} from 'angular2/core';
|
||||
import {bootstrap} from 'angular2/platform/browser';
|
||||
import {
|
||||
OnActivate,
|
||||
ComponentInstruction,
|
||||
RouteConfig,
|
||||
ROUTER_DIRECTIVES,
|
||||
APP_BASE_HREF
|
||||
} from 'angular2/router';
|
||||
import {OnActivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
|
||||
import {APP_BASE_HREF} from 'angular2/platform/common';
|
||||
|
||||
// #docregion routerOnActivate
|
||||
@Component({template: `Child`})
|
||||
|
@ -1,12 +1,7 @@
|
||||
import {Component, Injectable, provide} from 'angular2/core';
|
||||
import {bootstrap} from 'angular2/platform/browser';
|
||||
import {
|
||||
OnDeactivate,
|
||||
ComponentInstruction,
|
||||
RouteConfig,
|
||||
ROUTER_DIRECTIVES,
|
||||
APP_BASE_HREF
|
||||
} from 'angular2/router';
|
||||
import {OnDeactivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
|
||||
import {APP_BASE_HREF} from 'angular2/platform/common';
|
||||
|
||||
|
||||
@Injectable()
|
||||
|
@ -5,11 +5,11 @@ import {
|
||||
RouteConfig,
|
||||
ComponentInstruction,
|
||||
ROUTER_DIRECTIVES,
|
||||
APP_BASE_HREF,
|
||||
CanReuse,
|
||||
RouteParams,
|
||||
OnReuse
|
||||
} from 'angular2/router';
|
||||
import {APP_BASE_HREF} from 'angular2/platform/common';
|
||||
|
||||
|
||||
// #docregion reuseCmp
|
||||
|
Reference in New Issue
Block a user