refactor: change provide(...) for {provide: ...}
- provide() is deprecated, - {} syntax is required by the offline compiler
This commit is contained in:
@ -20,7 +20,7 @@ export function main() {
|
||||
var locationStrategy: HashLocationStrategy;
|
||||
|
||||
beforeEachProviders(
|
||||
() => [HashLocationStrategy, provide(PlatformLocation, {useClass: SpyPlatformLocation})]);
|
||||
() => [HashLocationStrategy, {provide: PlatformLocation, useClass: SpyPlatformLocation}]);
|
||||
|
||||
describe('without APP_BASE_HREF', () => {
|
||||
beforeEach(inject([PlatformLocation, HashLocationStrategy], (pl, ls) => {
|
||||
@ -61,7 +61,7 @@ export function main() {
|
||||
});
|
||||
|
||||
describe('with APP_BASE_HREF with neither leading nor trailing slash', () => {
|
||||
beforeEachProviders(() => [provide(APP_BASE_HREF, {useValue: 'app'})]);
|
||||
beforeEachProviders(() => [{provide: APP_BASE_HREF, useValue: 'app'}]);
|
||||
|
||||
beforeEach(inject([PlatformLocation, HashLocationStrategy], (pl, ls) => {
|
||||
platformLocation = pl;
|
||||
@ -94,7 +94,7 @@ export function main() {
|
||||
});
|
||||
|
||||
describe('with APP_BASE_HREF with leading slash', () => {
|
||||
beforeEachProviders(() => [provide(APP_BASE_HREF, {useValue: '/app'})]);
|
||||
beforeEachProviders(() => [{provide: APP_BASE_HREF, useValue: '/app'}]);
|
||||
|
||||
beforeEach(inject([PlatformLocation, HashLocationStrategy], (pl, ls) => {
|
||||
platformLocation = pl;
|
||||
@ -127,7 +127,7 @@ export function main() {
|
||||
});
|
||||
|
||||
describe('with APP_BASE_HREF with both leading and trailing slash', () => {
|
||||
beforeEachProviders(() => [provide(APP_BASE_HREF, {useValue: '/app/'})]);
|
||||
beforeEachProviders(() => [{provide: APP_BASE_HREF, useValue: '/app/'}]);
|
||||
|
||||
beforeEach(inject([PlatformLocation, HashLocationStrategy], (pl, ls) => {
|
||||
platformLocation = pl;
|
||||
|
@ -24,7 +24,7 @@ export function main() {
|
||||
locationStrategy = new MockLocationStrategy();
|
||||
locationStrategy.internalBaseHref = baseHref;
|
||||
let injector = ReflectiveInjector.resolveAndCreate(
|
||||
[Location, provide(LocationStrategy, {useValue: locationStrategy}), provider]);
|
||||
[Location, {provide: LocationStrategy, useValue: locationStrategy}, provider]);
|
||||
return location = injector.get(Location);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ export function main() {
|
||||
|
||||
beforeEachProviders(() => [
|
||||
PathLocationStrategy,
|
||||
provide(PlatformLocation, {useFactory: makeSpyPlatformLocation})
|
||||
{provide: PlatformLocation, useFactory: makeSpyPlatformLocation}
|
||||
]);
|
||||
|
||||
it('should throw without a base element or APP_BASE_HREF', () => {
|
||||
@ -67,7 +67,7 @@ export function main() {
|
||||
});
|
||||
|
||||
describe('with APP_BASE_HREF with neither leading nor trailing slash', () => {
|
||||
beforeEachProviders(() => [provide(APP_BASE_HREF, {useValue: 'app'})]);
|
||||
beforeEachProviders(() => [{provide: APP_BASE_HREF, useValue: 'app'}]);
|
||||
|
||||
beforeEach(inject([PlatformLocation, PathLocationStrategy], (pl, ls) => {
|
||||
platformLocation = pl;
|
||||
@ -100,7 +100,7 @@ export function main() {
|
||||
});
|
||||
|
||||
describe('with APP_BASE_HREF with leading slash', () => {
|
||||
beforeEachProviders(() => [provide(APP_BASE_HREF, {useValue: '/app'})]);
|
||||
beforeEachProviders(() => [{provide: APP_BASE_HREF, useValue: '/app'}]);
|
||||
|
||||
beforeEach(inject([PlatformLocation, PathLocationStrategy], (pl, ls) => {
|
||||
platformLocation = pl;
|
||||
@ -133,7 +133,7 @@ export function main() {
|
||||
});
|
||||
|
||||
describe('with APP_BASE_HREF with both leading and trailing slash', () => {
|
||||
beforeEachProviders(() => [provide(APP_BASE_HREF, {useValue: '/app/'})]);
|
||||
beforeEachProviders(() => [{provide: APP_BASE_HREF, useValue: '/app/'}]);
|
||||
|
||||
beforeEach(inject([PlatformLocation, PathLocationStrategy], (pl, ls) => {
|
||||
platformLocation = pl;
|
||||
|
Reference in New Issue
Block a user