refactor(router): refactor BrowserLocation into LocationStrategy

This makes it easy to mock browser location and paves the way to
implementing hash routing.
This commit is contained in:
Brian Ford
2015-06-22 12:14:19 -07:00
parent b48f000657
commit e5de1f771a
8 changed files with 86 additions and 62 deletions

View File

@ -32,6 +32,8 @@ import {EventManager, DomEventsPlugin} from 'angular2/src/render/dom/events/even
import {MockTemplateResolver} from 'angular2/src/mock/template_resolver_mock';
import {MockXHR} from 'angular2/src/render/xhr_mock';
import {MockLocationStrategy} from 'angular2/src/mock/mock_location_strategy';
import {LocationStrategy} from 'angular2/src/router/location_strategy';
import {MockNgZone} from 'angular2/src/mock/ng_zone_mock';
import {TestBed} from './test_bed';
@ -109,6 +111,7 @@ function _getAppBindings() {
Parser,
Lexer,
ExceptionHandler,
bind(LocationStrategy).toClass(MockLocationStrategy),
bind(XHR).toClass(MockXHR),
ComponentUrlMapper,
UrlResolver,