diff --git a/modules/@angular/common/src/forms/form_builder.ts b/modules/@angular/common/src/forms/form_builder.ts index 1a2bc938e8..2109cf13b5 100644 --- a/modules/@angular/common/src/forms/form_builder.ts +++ b/modules/@angular/common/src/forms/form_builder.ts @@ -13,7 +13,7 @@ import {ValidatorFn, AsyncValidatorFn} from './directives/validators'; * ```typescript * @Component({ * selector: 'my-app', - * viewBindings: [FORM_BINDINGS] + * viewProviders: [FORM_BINDINGS] * template: ` *
*

Login

diff --git a/modules/@angular/compiler/test/test_component_builder_spec.ts b/modules/@angular/compiler/test/test_component_builder_spec.ts index a59b049a75..a19e5966e3 100644 --- a/modules/@angular/compiler/test/test_component_builder_spec.ts +++ b/modules/@angular/compiler/test/test_component_builder_spec.ts @@ -154,7 +154,7 @@ class MockFancyService extends FancyService { @Component({ selector: 'my-service-comp', - bindings: [FancyService], + providers: [FancyService], template: `injected value: {{fancyService.value}}` }) class TestBindingsComp { diff --git a/modules/@angular/compiler/testing/directive_resolver_mock.ts b/modules/@angular/compiler/testing/directive_resolver_mock.ts index 4cb0e8fcb1..75d8a8220a 100644 --- a/modules/@angular/compiler/testing/directive_resolver_mock.ts +++ b/modules/@angular/compiler/testing/directive_resolver_mock.ts @@ -56,20 +56,6 @@ export class MockDirectiveResolver extends DirectiveResolver { }); } - /** - * @deprecated - */ - setBindingsOverride(type: Type, bindings: any[]): void { - this._providerOverrides.set(type, bindings); - } - - /** - * @deprecated - */ - setViewBindingsOverride(type: Type, viewBindings: any[]): void { - this.viewProviderOverrides.set(type, viewBindings); - } - setProvidersOverride(type: Type, providers: any[]): void { this._providerOverrides.set(type, providers); } diff --git a/modules/@angular/compiler/testing/test_component_builder.ts b/modules/@angular/compiler/testing/test_component_builder.ts index fad43a98e7..a3d2655209 100644 --- a/modules/@angular/compiler/testing/test_component_builder.ts +++ b/modules/@angular/compiler/testing/test_component_builder.ts @@ -344,9 +344,9 @@ export class TestComponentBuilder { (to, from) => { mockViewResolver.overrideViewDirective(component, from, to); }); }); this._bindingsOverrides.forEach( - (bindings, type) => mockDirectiveResolver.setBindingsOverride(type, bindings)); + (bindings, type) => mockDirectiveResolver.setProvidersOverride(type, bindings)); this._viewBindingsOverrides.forEach( - (bindings, type) => mockDirectiveResolver.setViewBindingsOverride(type, bindings)); + (bindings, type) => mockDirectiveResolver.setViewProvidersOverride(type, bindings)); let promise: Promise> = this._injector.get(ComponentResolver).resolveComponent(rootComponentType); diff --git a/modules/@angular/core/src/metadata.dart b/modules/@angular/core/src/metadata.dart index fe0c8b9a57..3f8abb02a8 100644 --- a/modules/@angular/core/src/metadata.dart +++ b/modules/@angular/core/src/metadata.dart @@ -32,8 +32,6 @@ class Directive extends DirectiveMetadata { @Deprecated('Use `outputs` or `@Output` instead') List events, Map host, - @Deprecated('Use `providers` instead') - List bindings, List providers, String exportAs, Map queries}) @@ -44,7 +42,6 @@ class Directive extends DirectiveMetadata { properties: properties, events: events, host: host, - bindings: bindings, providers: providers, exportAs: exportAs, queries: queries); @@ -63,14 +60,10 @@ class Component extends ComponentMetadata { @Deprecated('Use `outputs` or `@Output` instead') List events, Map host, - @Deprecated('Use `providers` instead') - List bindings, List providers, String exportAs, String moduleId, Map queries, - @Deprecated('Use `viewProviders` instead') - List viewBindings, List viewProviders, ChangeDetectionStrategy changeDetection, String templateUrl, @@ -87,11 +80,9 @@ class Component extends ComponentMetadata { properties: properties, events: events, host: host, - bindings: bindings, providers: providers, exportAs: exportAs, moduleId: moduleId, - viewBindings: viewBindings, viewProviders: viewProviders, queries: queries, changeDetection: changeDetection, diff --git a/modules/@angular/core/src/metadata.ts b/modules/@angular/core/src/metadata.ts index fa83bab0dd..d6568b650f 100644 --- a/modules/@angular/core/src/metadata.ts +++ b/modules/@angular/core/src/metadata.ts @@ -153,7 +153,6 @@ export interface DirectiveMetadataFactory { properties?: string[], events?: string[], host?: {[key: string]: string}, - bindings?: any[], providers?: any[], exportAs?: string, queries?: {[key: string]: any} @@ -165,7 +164,6 @@ export interface DirectiveMetadataFactory { properties?: string[], events?: string[], host?: {[key: string]: string}, - bindings?: any[], providers?: any[], exportAs?: string, queries?: {[key: string]: any} @@ -211,13 +209,10 @@ export interface ComponentMetadataFactory { properties?: string[], events?: string[], host?: {[key: string]: string}, - /* @deprecated */ - bindings?: any[], providers?: any[], exportAs?: string, moduleId?: string, queries?: {[key: string]: any}, - viewBindings?: any[], viewProviders?: any[], changeDetection?: ChangeDetectionStrategy, templateUrl?: string, @@ -235,14 +230,10 @@ export interface ComponentMetadataFactory { properties?: string[], events?: string[], host?: {[key: string]: string}, - /* @deprecated */ - bindings?: any[], providers?: any[], exportAs?: string, moduleId?: string, queries?: {[key: string]: any}, - /* @deprecated */ - viewBindings?: any[], viewProviders?: any[], changeDetection?: ChangeDetectionStrategy, templateUrl?: string, diff --git a/modules/@angular/core/src/metadata/directives.ts b/modules/@angular/core/src/metadata/directives.ts index 9234828724..e7b237ab3e 100644 --- a/modules/@angular/core/src/metadata/directives.ts +++ b/modules/@angular/core/src/metadata/directives.ts @@ -649,7 +649,7 @@ export class DirectiveMetadata extends InjectableMetadata { * * @Directive({ * selector: 'greet', - * bindings: [ + * providers: [ * Greeter * ] * }) @@ -663,13 +663,9 @@ export class DirectiveMetadata extends InjectableMetadata { * ``` */ get providers(): any[] { - return isPresent(this._bindings) && this._bindings.length > 0 ? this._bindings : - this._providers; + return this._providers; } - /** @deprecated */ - get bindings(): any[] { return this.providers; } private _providers: any[]; - private _bindings: any[]; /** * Defines the name that can be used in the template to assign this directive to a variable. @@ -731,7 +727,7 @@ export class DirectiveMetadata extends InjectableMetadata { */ queries: {[key: string]: any}; - constructor({selector, inputs, outputs, properties, events, host, bindings, providers, exportAs, + constructor({selector, inputs, outputs, properties, events, host, providers, exportAs, queries}: { selector?: string, inputs?: string[], @@ -740,7 +736,6 @@ export class DirectiveMetadata extends InjectableMetadata { events?: string[], host?: {[key: string]: string}, providers?: any[], - /** @deprecated */ bindings?: any[], exportAs?: string, queries?: {[key: string]: any} } = {}) { @@ -754,7 +749,6 @@ export class DirectiveMetadata extends InjectableMetadata { this.exportAs = exportAs; this.queries = queries; this._providers = providers; - this._bindings = bindings; } } @@ -836,12 +830,9 @@ export class ComponentMetadata extends DirectiveMetadata { * ``` */ get viewProviders(): any[] { - return isPresent(this._viewBindings) && this._viewBindings.length > 0 ? this._viewBindings : - this._viewProviders; + return this._viewProviders; } - get viewBindings(): any[] { return this.viewProviders; } private _viewProviders: any[]; - private _viewBindings: any[]; /** * The module id of the module that contains the component. @@ -877,8 +868,8 @@ export class ComponentMetadata extends DirectiveMetadata { encapsulation: ViewEncapsulation; - constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, bindings, - providers, viewBindings, viewProviders, + constructor({selector, inputs, outputs, properties, events, host, exportAs, moduleId, + providers, viewProviders, changeDetection = ChangeDetectionStrategy.Default, queries, templateUrl, template, styleUrls, styles, directives, pipes, encapsulation}: { selector?: string, @@ -887,11 +878,9 @@ export class ComponentMetadata extends DirectiveMetadata { properties?: string[], events?: string[], host?: {[key: string]: string}, - /** @deprecated */ bindings?: any[], providers?: any[], exportAs?: string, moduleId?: string, - /** @deprecated */ viewBindings?: any[], viewProviders?: any[], queries?: {[key: string]: any}, changeDetection?: ChangeDetectionStrategy, @@ -911,14 +900,12 @@ export class ComponentMetadata extends DirectiveMetadata { events: events, host: host, exportAs: exportAs, - bindings: bindings, providers: providers, queries: queries }); this.changeDetection = changeDetection; this._viewProviders = viewProviders; - this._viewBindings = viewBindings; this.templateUrl = templateUrl; this.template = template; this.styleUrls = styleUrls; diff --git a/modules/@angular/core/test/linker/integration_dart_spec.dart b/modules/@angular/core/test/linker/integration_dart_spec.dart index 1b7b376883..16f427b689 100644 --- a/modules/@angular/core/test/linker/integration_dart_spec.dart +++ b/modules/@angular/core/test/linker/integration_dart_spec.dart @@ -250,7 +250,7 @@ class OnChangeComponent implements OnChanges { selector: 'component-with-observable-list', changeDetection: ChangeDetectionStrategy.OnPush, inputs: const ['list'], - bindings: const [ + providers: const [ const Binding(IterableDiffers, toValue: const IterableDiffers(const [ const ObservableListDiffFactory(), diff --git a/modules/@angular/docs/core/02_directives.md b/modules/@angular/docs/core/02_directives.md index 7200ed6e05..8b8af38095 100644 --- a/modules/@angular/docs/core/02_directives.md +++ b/modules/@angular/docs/core/02_directives.md @@ -214,7 +214,7 @@ To better understand the kinds of injections which are supported in Angular we h ### Injecting Services -Service injection is the most straight forward kind of injection which Angular supports. It involves a component configuring the `bindings` or `viewBindings` and then letting the directive ask for the configured service. +Service injection is the most straight forward kind of injection which Angular supports. It involves a component configuring the `providers` or `viewProviders` and then letting the directive ask for the configured service. This example illustrates how to inject `MyService` into `House` directive. @@ -225,7 +225,7 @@ class MyService {} | Assume a service which needs to be inject | @Component({ | Assume a top level application component which selector: 'my-app', | configures the services to be injected. - viewBindings: [MyService], | + viewProviders: [MyService], | templateUrl: 'my_app.html', | Assume we have a template that needs to be directives: [House] | configured with directives to be injected. }) | @@ -351,7 +351,7 @@ class Dad { @Component({ selector: '[grandpa]', - viewBindings: [], + viewProviders: [], templateUrl: 'grandpa.html', directives: [Dad] }) diff --git a/modules/@angular/docs/di/di_advanced.md b/modules/@angular/docs/di/di_advanced.md index caa64164ac..3ae2e7e4b1 100644 --- a/modules/@angular/docs/di/di_advanced.md +++ b/modules/@angular/docs/di/di_advanced.md @@ -24,7 +24,7 @@ var inj = Injector.resolveAndCreate([ var engine = inj.get(ENGINE_KEY); // no mapping ``` -Every key has an id, which we utilize to store bindings and instances. So Injector uses keys internally for performance reasons. +Every key has an id, which we utilize to store providers and instances. So Injector uses keys internally for performance reasons. ### ProtoInjector and Injector @@ -33,15 +33,15 @@ Often there is a need to create multiple instances of essentially the same injec Doing the following would be very inefficient. ``` -function createComponetInjector(parent, bindings: Binding[]) { - return parent.resolveAndCreateChild(bindings); +function createComponetInjector(parent, providers: Binding[]) { + return parent.resolveAndCreateChild(providers); } ``` -This would require us to resolve and store bindings for every single component instance. Instead, we want to resolve and store the bindings for every component type, and create a set of instances for every component. To enable that DI separates the meta information about injectables (Bindings and their dependencies), which are stored in `ProtoInjector`, and injectables themselves, which are stored in `Injector`. +This would require us to resolve and store providers for every single component instance. Instead, we want to resolve and store the providers for every component type, and create a set of instances for every component. To enable that DI separates the meta information about injectables (providers and their dependencies), which are stored in `ProtoInjector`, and injectables themselves, which are stored in `Injector`. ``` -var proto = new ProtoInjector(bindings); // done once +var proto = new ProtoInjector(providers); // done once function createComponentInjector(parent, proto) { return new Injector(proto, parent); } @@ -74,7 +74,7 @@ Imagine the following scenario: Child1 Child2 ``` -Here both Child1 and Child2 are children of ParentInjector. Child2 marks this relationship as host. ParentInjector might want to expose two different sets of bindings for its "regular" children and its "host" children. Bindings visible to "regular" children are called "public" and bindings visible to "host" children are called "private". This is an advanced use case used by Angular, where components can provide different sets of bindings for their children and their view. +Here both Child1 and Child2 are children of ParentInjector. Child2 marks this relationship as host. ParentInjector might want to expose two different sets of providers for its "regular" children and its "host" children. providers visible to "regular" children are called "public" and providers visible to "host" children are called "private". This is an advanced use case used by Angular, where components can provide different sets of providers for their children and their view. Let's look at this example. @@ -154,12 +154,12 @@ Now let's see how Angular 2 uses DI behind the scenes. The right mental model is to think that every DOM element has an Injector. (In practice, only interesting elements containing directives will have an injector, but this is a performance optimization) -There are two properties that can be used to configure DI: bindings and viewBindings. +There are two properties that can be used to configure DI: providers and viewProviders. -- `bindings` affects the element and its children. -- `viewBindings` affects the component's view. +- `providers` affects the element and its children. +- `viewProviders` affects the component's view. -Every directive can declare injectables via `bindings`, but only components can declare `viewBindings`. +Every directive can declare injectables via `providers`, but only components can declare `viewProviders`. Let's look at a complex example that shows how the injector tree gets created. @@ -174,10 +174,10 @@ Both `MyComponent` and `MyDirective` are created on the same element. ``` @Component({ selector: 'my-component', - bindings: [ + providers: [ bind('componentService').toValue('Host_MyComponentService') ], - viewBindings: [ + viewProviders: [ bind('viewService').toValue('View_MyComponentService') ], template: ``, @@ -187,7 +187,7 @@ class MyComponent {} @Directive({ selector: '[my-directive]', - bindings: [ + providers: [ bind('directiveService').toValue('MyDirectiveService') ] }) @@ -231,5 +231,5 @@ Injector2 [ Injector3 [ ] ] ``` -As you can see the component and its bindings can be seen by its children and its view. The view bindings can be seen only by the view. And the bindings of other directives can be seen only their children. +As you can see the component and its providers can be seen by its children and its view. The view providers can be seen only by the view. And the providers of other directives can be seen only their children. diff --git a/modules/@angular/platform-browser/testing/perf_util.ts b/modules/@angular/platform-browser/testing/perf_util.ts index 2d4f919c8f..4d5c784066 100644 --- a/modules/@angular/platform-browser/testing/perf_util.ts +++ b/modules/@angular/platform-browser/testing/perf_util.ts @@ -31,7 +31,7 @@ export function runBenchmark(config) { execute: config.work, prepare: config.prepare, microMetrics: config.microMetrics, - bindings: [bind(Options.SAMPLE_DESCRIPTION).toValue(description)] + providers: [bind(Options.SAMPLE_DESCRIPTION).toValue(description)] }); }); }); diff --git a/modules/angular1_router/test/integration/router_spec.js b/modules/angular1_router/test/integration/router_spec.js index 3e5a96c24e..37b4508a59 100644 --- a/modules/angular1_router/test/integration/router_spec.js +++ b/modules/angular1_router/test/integration/router_spec.js @@ -34,7 +34,7 @@ describe('router', function () { it('should bind the component to the current router', function() { var router; registerComponent('homeCmp', { - bindings: { $router: '=' }, + providers: { $router: '=' }, controller: function($scope, $element) { this.$routerOnActivate = function() { router = this.$router; @@ -148,7 +148,7 @@ describe('router', function () { it('should provide the root level router', function() { registerComponent('homeCmp', { template: 'Home ({{homeCmp.isAdmin}})', - bindings: { + providers: { $router: '<' } }); @@ -175,8 +175,8 @@ describe('router', function () { function registerComponent(name, options) { var definition = { - bindings: options.bindings, - controller: getController(options), + providers: options.providers, + controller: getController(options) }; if (options.template) definition.template = options.template; if (options.templateUrl) definition.templateUrl = options.templateUrl; diff --git a/modules/benchpress/docs/index.md b/modules/benchpress/docs/index.md index b594d060e6..c906f00741 100644 --- a/modules/benchpress/docs/index.md +++ b/modules/benchpress/docs/index.md @@ -173,7 +173,7 @@ To collect these metrics, you need to execute `console.time('frameCapture')` and In addition to that, one extra binding needs to be passed to benchpress in tests that want to collect these metrics: - benchpress.sample(bindings: [bp.bind(bp.Options.CAPTURE_FRAMES).toValue(true)], ... ) + benchpress.sample(providers: [bp.bind(bp.Options.CAPTURE_FRAMES).toValue(true)], ... ) # Requests Metrics @@ -182,9 +182,9 @@ Benchpress can also record the number of requests sent and count the received "e - `receivedData`: number of bytes received since the last navigation start - `requestCount`: number of requests sent since the last navigation start -To collect these metrics, you need the following corresponding extra bindings: +To collect these metrics, you need the following corresponding extra providers: - benchpress.sample(bindings: [ + benchpress.sample(providers: [ bp.bind(bp.Options.RECEIVED_DATA).toValue(true), bp.bind(bp.Options.REQUEST_COUNT).toValue(true) ], ... ) diff --git a/modules/benchpress/src/metric/perflog_metric.ts b/modules/benchpress/src/metric/perflog_metric.ts index 1510c55fb5..831157677c 100644 --- a/modules/benchpress/src/metric/perflog_metric.ts +++ b/modules/benchpress/src/metric/perflog_metric.ts @@ -20,7 +20,7 @@ import {Options} from '../common_options'; */ export class PerflogMetric extends Metric { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } // TODO(tbosch): use static values when our transpiler supports them static get SET_TIMEOUT(): OpaqueToken { return _SET_TIMEOUT; } diff --git a/modules/benchpress/src/reporter/console_reporter.ts b/modules/benchpress/src/reporter/console_reporter.ts index 4fb0473802..898d3cb5a0 100644 --- a/modules/benchpress/src/reporter/console_reporter.ts +++ b/modules/benchpress/src/reporter/console_reporter.ts @@ -18,7 +18,7 @@ export class ConsoleReporter extends Reporter { // TODO(tbosch): use static values when our transpiler supports them static get COLUMN_WIDTH(): OpaqueToken { return _COLUMN_WIDTH; } // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } static _lpad(value, columnWidth, fill = ' ') { diff --git a/modules/benchpress/src/reporter/json_file_reporter.ts b/modules/benchpress/src/reporter/json_file_reporter.ts index 2bac51f714..4065f9ff26 100644 --- a/modules/benchpress/src/reporter/json_file_reporter.ts +++ b/modules/benchpress/src/reporter/json_file_reporter.ts @@ -15,7 +15,7 @@ export class JsonFileReporter extends Reporter { // TODO(tbosch): use static values when our transpiler supports them static get PATH(): OpaqueToken { return _PATH; } // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } _writeFile: Function; _path: string; diff --git a/modules/benchpress/src/runner.ts b/modules/benchpress/src/runner.ts index c5449dbb4d..6f0fbe461d 100644 --- a/modules/benchpress/src/runner.ts +++ b/modules/benchpress/src/runner.ts @@ -25,34 +25,34 @@ import {Options} from './common_options'; * It provides defaults, creates the injector and calls the sampler. */ export class Runner { - private _defaultBindings: Provider[]; - constructor(defaultBindings: Provider[] = null) { - if (isBlank(defaultBindings)) { - defaultBindings = []; + private _defaultProviders: Provider[]; + constructor(defaultProviders: Provider[] = null) { + if (isBlank(defaultProviders)) { + defaultProviders = []; } - this._defaultBindings = defaultBindings; + this._defaultProviders = defaultProviders; } - sample({id, execute, prepare, microMetrics, bindings}: - {id: string, execute?: any, prepare?: any, microMetrics?: any, bindings?: any}): + sample({id, execute, prepare, microMetrics, providers}: + {id: string, execute?: any, prepare?: any, microMetrics?: any, providers?: any}): Promise { - var sampleBindings = [ + var sampleProviders = [ _DEFAULT_PROVIDERS, - this._defaultBindings, + this._defaultProviders, bind(Options.SAMPLE_ID).toValue(id), bind(Options.EXECUTE).toValue(execute) ]; if (isPresent(prepare)) { - sampleBindings.push(bind(Options.PREPARE).toValue(prepare)); + sampleProviders.push(bind(Options.PREPARE).toValue(prepare)); } if (isPresent(microMetrics)) { - sampleBindings.push(bind(Options.MICRO_METRICS).toValue(microMetrics)); + sampleProviders.push(bind(Options.MICRO_METRICS).toValue(microMetrics)); } - if (isPresent(bindings)) { - sampleBindings.push(bindings); + if (isPresent(providers)) { + sampleProviders.push(providers); } - var inj = ReflectiveInjector.resolveAndCreate(sampleBindings); + var inj = ReflectiveInjector.resolveAndCreate(sampleProviders); var adapter = inj.get(WebDriverAdapter); return PromiseWrapper @@ -67,7 +67,7 @@ export class Runner { // TODO vsavkin consider changing it when toAsyncFactory is added back or when child // injectors are handled better. var injector = ReflectiveInjector.resolveAndCreate([ - sampleBindings, + sampleProviders, bind(Options.CAPABILITIES).toValue(capabilities), bind(Options.USER_AGENT).toValue(userAgent), provide(WebDriverAdapter, {useValue: adapter}) @@ -81,15 +81,15 @@ export class Runner { var _DEFAULT_PROVIDERS = [ Options.DEFAULT_PROVIDERS, - Sampler.BINDINGS, - ConsoleReporter.BINDINGS, - RegressionSlopeValidator.BINDINGS, - SizeValidator.BINDINGS, - ChromeDriverExtension.BINDINGS, - FirefoxDriverExtension.BINDINGS, - IOsDriverExtension.BINDINGS, - PerflogMetric.BINDINGS, - SampleDescription.BINDINGS, + Sampler.PROVIDERS, + ConsoleReporter.PROVIDERS, + RegressionSlopeValidator.PROVIDERS, + SizeValidator.PROVIDERS, + ChromeDriverExtension.PROVIDERS, + FirefoxDriverExtension.PROVIDERS, + IOsDriverExtension.PROVIDERS, + PerflogMetric.PROVIDERS, + SampleDescription.PROVIDERS, MultiReporter.createBindings([ConsoleReporter]), MultiMetric.createBindings([PerflogMetric]), diff --git a/modules/benchpress/src/sample_description.ts b/modules/benchpress/src/sample_description.ts index 0720ae4225..c8679f4560 100644 --- a/modules/benchpress/src/sample_description.ts +++ b/modules/benchpress/src/sample_description.ts @@ -9,7 +9,7 @@ import {Options} from './common_options'; */ export class SampleDescription { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } description: {[key: string]: any}; constructor(public id: string, descriptions: Array<{[key: string]: any}>, diff --git a/modules/benchpress/src/sampler.ts b/modules/benchpress/src/sampler.ts index 75e5a22435..a5ec0c06e5 100644 --- a/modules/benchpress/src/sampler.ts +++ b/modules/benchpress/src/sampler.ts @@ -20,7 +20,7 @@ import {MeasureValues} from './measure_values'; */ export class Sampler { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } _driver: WebDriverAdapter; _metric: Metric; diff --git a/modules/benchpress/src/validator/regression_slope_validator.ts b/modules/benchpress/src/validator/regression_slope_validator.ts index 839c7435eb..b5ac1fefdf 100644 --- a/modules/benchpress/src/validator/regression_slope_validator.ts +++ b/modules/benchpress/src/validator/regression_slope_validator.ts @@ -15,7 +15,7 @@ export class RegressionSlopeValidator extends Validator { // TODO(tbosch): use static values when our transpiler supports them static get METRIC(): OpaqueToken { return _METRIC; } // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } _sampleSize: number; _metric: string; diff --git a/modules/benchpress/src/validator/size_validator.ts b/modules/benchpress/src/validator/size_validator.ts index 55d105e342..b96567b8b8 100644 --- a/modules/benchpress/src/validator/size_validator.ts +++ b/modules/benchpress/src/validator/size_validator.ts @@ -9,7 +9,7 @@ import {MeasureValues} from '../measure_values'; */ export class SizeValidator extends Validator { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } // TODO(tbosch): use static values when our transpiler supports them static get SAMPLE_SIZE() { return _SAMPLE_SIZE; } diff --git a/modules/benchpress/src/webdriver/chrome_driver_extension.ts b/modules/benchpress/src/webdriver/chrome_driver_extension.ts index dda2d30bbe..421707e85f 100644 --- a/modules/benchpress/src/webdriver/chrome_driver_extension.ts +++ b/modules/benchpress/src/webdriver/chrome_driver_extension.ts @@ -23,7 +23,7 @@ import {Options} from '../common_options'; */ export class ChromeDriverExtension extends WebDriverExtension { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } private _majorChromeVersion: number; diff --git a/modules/benchpress/src/webdriver/firefox_driver_extension.ts b/modules/benchpress/src/webdriver/firefox_driver_extension.ts index 5f8f60b9a8..1bf6dc940e 100644 --- a/modules/benchpress/src/webdriver/firefox_driver_extension.ts +++ b/modules/benchpress/src/webdriver/firefox_driver_extension.ts @@ -4,7 +4,7 @@ import {WebDriverExtension, PerfLogFeatures} from '../web_driver_extension'; import {WebDriverAdapter} from '../web_driver_adapter'; export class FirefoxDriverExtension extends WebDriverExtension { - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } private _profilerStarted: boolean; diff --git a/modules/benchpress/src/webdriver/ios_driver_extension.ts b/modules/benchpress/src/webdriver/ios_driver_extension.ts index 009ef4c807..7d583db254 100644 --- a/modules/benchpress/src/webdriver/ios_driver_extension.ts +++ b/modules/benchpress/src/webdriver/ios_driver_extension.ts @@ -7,7 +7,7 @@ import {WebDriverAdapter} from '../web_driver_adapter'; export class IOsDriverExtension extends WebDriverExtension { // TODO(tbosch): use static values when our transpiler supports them - static get BINDINGS(): Provider[] { return _PROVIDERS; } + static get PROVIDERS(): Provider[] { return _PROVIDERS; } constructor(private _driver: WebDriverAdapter) { super(); } diff --git a/modules/benchpress/test/firefox_extension/sample_benchmark.ts b/modules/benchpress/test/firefox_extension/sample_benchmark.ts index c3d34df92d..a5d0b03cba 100644 --- a/modules/benchpress/test/firefox_extension/sample_benchmark.ts +++ b/modules/benchpress/test/firefox_extension/sample_benchmark.ts @@ -25,7 +25,7 @@ describe('deep tree baseline', function() { id: 'baseline', execute: function() { $('button') .click(); }, - bindings: [benchpress.bind(benchpress.Options.SAMPLE_DESCRIPTION).toValue({depth: 9})] + providers: [benchpress.bind(benchpress.Options.SAMPLE_DESCRIPTION).toValue({depth: 9})] }) .then(done, done.fail); }); diff --git a/modules/benchpress/test/metric/perflog_metric_spec.ts b/modules/benchpress/test/metric/perflog_metric_spec.ts index 94d64e6ec6..4e925e0975 100644 --- a/modules/benchpress/test/metric/perflog_metric_spec.ts +++ b/modules/benchpress/test/metric/perflog_metric_spec.ts @@ -48,9 +48,9 @@ export function main() { if (isBlank(microMetrics)) { microMetrics = StringMapWrapper.create(); } - var bindings = [ + var providers = [ Options.DEFAULT_PROVIDERS, - PerflogMetric.BINDINGS, + PerflogMetric.PROVIDERS, bind(Options.MICRO_METRICS).toValue(microMetrics), bind(PerflogMetric.SET_TIMEOUT) .toValue((fn, millis) => { @@ -61,18 +61,18 @@ export function main() { .toValue(new MockDriverExtension(perfLogs, commandLog, perfLogFeatures)) ]; if (isPresent(forceGc)) { - bindings.push(bind(Options.FORCE_GC).toValue(forceGc)); + providers.push(bind(Options.FORCE_GC).toValue(forceGc)); } if (isPresent(captureFrames)) { - bindings.push(bind(Options.CAPTURE_FRAMES).toValue(captureFrames)); + providers.push(bind(Options.CAPTURE_FRAMES).toValue(captureFrames)); } if (isPresent(receivedData)) { - bindings.push(bind(Options.RECEIVED_DATA).toValue(receivedData)); + providers.push(bind(Options.RECEIVED_DATA).toValue(receivedData)); } if (isPresent(requestCount)) { - bindings.push(bind(Options.REQUEST_COUNT).toValue(requestCount)); + providers.push(bind(Options.REQUEST_COUNT).toValue(requestCount)); } - return ReflectiveInjector.resolveAndCreate(bindings).get(PerflogMetric); + return ReflectiveInjector.resolveAndCreate(providers).get(PerflogMetric); } describe('perflog metric', () => { diff --git a/modules/benchpress/test/reporter/console_reporter_spec.ts b/modules/benchpress/test/reporter/console_reporter_spec.ts index 6646b9c76b..7dec37adda 100644 --- a/modules/benchpress/test/reporter/console_reporter_spec.ts +++ b/modules/benchpress/test/reporter/console_reporter_spec.ts @@ -37,7 +37,7 @@ export function main() { sampleId = 'null'; } var bindings = [ - ConsoleReporter.BINDINGS, + ConsoleReporter.PROVIDERS, provide(SampleDescription, {useValue: new SampleDescription(sampleId, descriptions, metrics)}), bind(ConsoleReporter.PRINT).toValue((line) => log.push(line)) diff --git a/modules/benchpress/test/reporter/json_file_reporter_spec.ts b/modules/benchpress/test/reporter/json_file_reporter_spec.ts index 930ad7ac58..3600f97fbb 100644 --- a/modules/benchpress/test/reporter/json_file_reporter_spec.ts +++ b/modules/benchpress/test/reporter/json_file_reporter_spec.ts @@ -32,7 +32,7 @@ export function main() { function createReporter({sampleId, descriptions, metrics, path}) { var bindings = [ - JsonFileReporter.BINDINGS, + JsonFileReporter.PROVIDERS, provide(SampleDescription, {useValue: new SampleDescription(sampleId, descriptions, metrics)}), bind(JsonFileReporter.PATH).toValue(path), diff --git a/modules/benchpress/test/runner_spec.ts b/modules/benchpress/test/runner_spec.ts index b8d43739e0..de00e14ebc 100644 --- a/modules/benchpress/test/runner_spec.ts +++ b/modules/benchpress/test/runner_spec.ts @@ -63,7 +63,7 @@ export function main() { it('should merge SampleDescription.description', inject([AsyncTestCompleter], (async) => { createRunner([bind(Options.DEFAULT_DESCRIPTION).toValue({'a': 1})]) - .sample({id: 'someId', bindings: [bind(Options.SAMPLE_DESCRIPTION).toValue({'b': 2})]}) + .sample({id: 'someId', providers: [bind(Options.SAMPLE_DESCRIPTION).toValue({'b': 2})]}) .then((_) => injector.get(SampleDescription)) .then((desc) => { expect(desc.description) @@ -121,7 +121,7 @@ export function main() { ]) .sample({ id: 'someId', - bindings: [ + providers: [ bind(Options.DEFAULT_DESCRIPTION) .toValue({'a': 2}), ] diff --git a/modules/benchpress/test/sampler_spec.ts b/modules/benchpress/test/sampler_spec.ts index 6046cdbe38..33a934685f 100644 --- a/modules/benchpress/test/sampler_spec.ts +++ b/modules/benchpress/test/sampler_spec.ts @@ -51,9 +51,9 @@ export function main() { if (isBlank(driver)) { driver = new MockDriverAdapter([]); } - var bindings = [ + var providers = [ Options.DEFAULT_PROVIDERS, - Sampler.BINDINGS, + Sampler.PROVIDERS, provide(Metric, {useValue: metric}), provide(Reporter, {useValue: reporter}), provide(WebDriverAdapter, {useValue: driver}), @@ -62,10 +62,10 @@ export function main() { bind(Options.NOW).toValue(() => DateWrapper.fromMillis(time++)) ]; if (isPresent(prepare)) { - bindings.push(bind(Options.PREPARE).toValue(prepare)); + providers.push(bind(Options.PREPARE).toValue(prepare)); } - sampler = ReflectiveInjector.resolveAndCreate(bindings).get(Sampler); + sampler = ReflectiveInjector.resolveAndCreate(providers).get(Sampler); } it('should call the prepare and execute callbacks using WebDriverAdapter.waitFor', diff --git a/modules/benchpress/test/validator/regression_slope_validator_spec.ts b/modules/benchpress/test/validator/regression_slope_validator_spec.ts index 1fd8187b6e..e356246a39 100644 --- a/modules/benchpress/test/validator/regression_slope_validator_spec.ts +++ b/modules/benchpress/test/validator/regression_slope_validator_spec.ts @@ -26,9 +26,9 @@ export function main() { function createValidator({size, metric}) { validator = ReflectiveInjector.resolveAndCreate([ - RegressionSlopeValidator.BINDINGS, - bind(RegressionSlopeValidator.METRIC).toValue(metric), - bind(RegressionSlopeValidator.SAMPLE_SIZE).toValue(size) + RegressionSlopeValidator.PROVIDERS, + provide(RegressionSlopeValidator.METRIC).toValue(metric), + provide(RegressionSlopeValidator.SAMPLE_SIZE).toValue(size) ]) .get(RegressionSlopeValidator); } diff --git a/modules/benchpress/test/validator/size_validator_spec.ts b/modules/benchpress/test/validator/size_validator_spec.ts index 963456cf2f..6a64def4eb 100644 --- a/modules/benchpress/test/validator/size_validator_spec.ts +++ b/modules/benchpress/test/validator/size_validator_spec.ts @@ -26,8 +26,8 @@ export function main() { function createValidator(size) { validator = ReflectiveInjector.resolveAndCreate([ - SizeValidator.BINDINGS, - bind(SizeValidator.SAMPLE_SIZE).toValue(size) + SizeValidator.PROVIDERS, + provide(SizeValidator.SAMPLE_SIZE).toValue(size) ]) .get(SizeValidator); } diff --git a/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts b/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts index b43d773047..ab38c8dcae 100644 --- a/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts +++ b/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts @@ -59,10 +59,10 @@ export function main() { log = []; extension = ReflectiveInjector.resolveAndCreate([ - ChromeDriverExtension.BINDINGS, - bind(WebDriverAdapter) + ChromeDriverExtension.PROVIDERS, + provide(WebDriverAdapter) .toValue(new MockDriverAdapter(log, perfRecords, messageMethod)), - bind(Options.USER_AGENT).toValue(userAgent) + provide(Options.USER_AGENT).toValue(userAgent) ]) .get(ChromeDriverExtension); return extension; diff --git a/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts b/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts index e07f8465fd..ac8158f4fb 100644 --- a/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts +++ b/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts @@ -38,7 +38,7 @@ export function main() { } log = []; extension = ReflectiveInjector.resolveAndCreate([ - IOsDriverExtension.BINDINGS, + IOsDriverExtension.PROVIDERS, provide(WebDriverAdapter, {useValue: new MockDriverAdapter(log, perfRecords)}) ]) diff --git a/modules/playground/src/person_management/index.ts b/modules/playground/src/person_management/index.ts index 76a3d8e67d..4bc6017028 100644 --- a/modules/playground/src/person_management/index.ts +++ b/modules/playground/src/person_management/index.ts @@ -179,7 +179,7 @@ class PersonsComponent { @Component({ selector: 'person-management-app', - viewBindings: [DataService], + viewProviders: [DataService], template: ` diff --git a/protractor-shared.js b/protractor-shared.js index 0aaee37561..ad6f47c0a5 100644 --- a/protractor-shared.js +++ b/protractor-shared.js @@ -225,7 +225,7 @@ exports.createBenchpressRunner = function(options) { benchpress.bind(benchpress.Options.FORCE_GC).toValue(argv['force-gc']), benchpress.bind(benchpress.Options.DEFAULT_DESCRIPTION) .toValue({'lang': options.lang, 'runId': runId}), - benchpress.JsonFileReporter.BINDINGS, + benchpress.JsonFileReporter.PROVIDERS, benchpress.bind(benchpress.JsonFileReporter.PATH).toValue(resultsFolder) ]; if (!argv['dryrun']) {