feat(di): rename Binding into Provider

Closes #4416

Closes #4654
This commit is contained in:
vsavkin
2015-10-10 22:11:13 -07:00
committed by Victor Savkin
parent 7c6130c2c5
commit 1eb0162cde
190 changed files with 2071 additions and 1816 deletions
@@ -1,5 +1,6 @@
import {
bind,
provide,
forwardRef,
Component,
ComponentRef,
@@ -8,7 +9,7 @@ import {
ElementRef,
Host,
Injectable,
ResolvedBinding,
ResolvedProvider,
SkipSelf,
Injector,
View,
@@ -54,7 +55,7 @@ export class MdDialog {
// Create the dialogRef here so that it can be injected into the content component.
var dialogRef = new MdDialogRef();
var bindings = Injector.resolve([bind(MdDialogRef).toValue(dialogRef)]);
var bindings = Injector.resolve([provide(MdDialogRef, {asValue: dialogRef})]);
var backdropRefPromise = this._openBackdrop(elementRef, bindings);
@@ -101,7 +102,7 @@ export class MdDialog {
}
/** Loads the dialog backdrop (transparent overlay over the rest of the page). */
_openBackdrop(elementRef: ElementRef, bindings: ResolvedBinding[]): Promise<ComponentRef> {
_openBackdrop(elementRef: ElementRef, bindings: ResolvedProvider[]): Promise<ComponentRef> {
return this.componentLoader.loadNextToLocation(MdBackdrop, elementRef, bindings)
.then((componentRef) => {
// TODO(tbosch): clean this up when we have custom renderers
@@ -14,7 +14,7 @@ import {
} from 'angular2/test_lib';
import {DebugElement} from 'angular2/src/core/debug/debug_element';
import {Component, View, ViewMetadata, UrlResolver, bind} from 'angular2/core';
import {Component, View, ViewMetadata, UrlResolver, bind, provide} from 'angular2/core';
import {MdButton, MdAnchor} from 'angular2_material/src/components/button/button';
@@ -37,7 +37,7 @@ export function main() {
// Need to use the real XHR implementation (instead of the mock) so we can actually request
// the template files, since Angular 2 doesn't have anything like $templateCache. This should
// eventually be replaced with a preprocessor that inlines templates.
bind(XHR).toClass(XHRImpl)
provide(XHR, {asClass: XHRImpl})
]);
beforeEach(inject([TestComponentBuilder], (tcb) => { builder = tcb; }));