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

@ -10,9 +10,6 @@ import {
Component,
Directive,
ViewContainerRef,
bind,
provide,
Provider,
ViewMetadata
} from '@angular/core';
@ -20,19 +17,19 @@ import {CompilerConfig, ViewResolver} from '@angular/compiler';
import {getIntParameter, bindAction} from '@angular/testing/src/benchmark_util';
function _createBindings(): Provider[] {
function _createBindings(): any[] {
var multiplyTemplatesBy = getIntParameter('elements');
return [
provide(ViewResolver,
{
useFactory: () => new MultiplyViewResolver(
{
provide: ViewResolver,
useFactory: () => new MultiplyViewResolver(
multiplyTemplatesBy,
[BenchmarkComponentNoBindings, BenchmarkComponentWithBindings]),
deps: []
}),
deps: []
},
// Use interpretative mode as Dart does not support JIT and
// we want to be able to compare the numbers between JS and Dart
provide(CompilerConfig, {useValue: new CompilerConfig(false, false, false)})
{provide: CompilerConfig, useValue: new CompilerConfig(false, false, false)}
];
}