refactor: change provide(...) for {provide: ...}

- provide() is deprecated,
- {} syntax is required by the offline compiler
This commit is contained in:
Victor Berchet
2016-06-02 17:30:40 -07:00
parent 27a47e7841
commit a6ad61d83e
128 changed files with 676 additions and 728 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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;