cleanup(di): renamed viewInjector and hostInjector

BREAKING CHANGE
    Replace viewInjector with viewBindings
    Replace hostInjector with bindings
This commit is contained in:
vsavkin
2015-07-29 15:01:22 -07:00
parent 70bc485755
commit 3cda7128d0
34 changed files with 126 additions and 119 deletions

View File

@ -29,7 +29,7 @@ class RedDec {
selector: 'hello-app',
// These are services that would be created if a class in the component's
// template tries to inject them.
viewInjector: [GreetingService]
viewBindings: [GreetingService]
})
// The template for the component.
@View({

View File

@ -12,7 +12,7 @@ import {isPresent} from 'angular2/src/facade/lang';
@Component({
selector: 'demo-app',
viewInjector: [MdDialog],
viewBindings: [MdDialog],
})
@View({
templateUrl: './demo_app.html',

View File

@ -5,7 +5,7 @@ import {UrlResolver} from 'angular2/src/services/url_resolver';
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
import {bind} from 'angular2/di';
@Component({selector: 'demo-app', viewInjector: [MdRadioDispatcher]})
@Component({selector: 'demo-app', viewBindings: [MdRadioDispatcher]})
@View({templateUrl: './demo_app.html', directives: [MdRadioGroup, MdRadioButton]})
class DemoApp {
thirdValue;

View File

@ -69,7 +69,7 @@ class ShowError {
}
@Component({selector: 'model-driven-forms', viewInjector: [FormBuilder]})
@Component({selector: 'model-driven-forms', viewBindings: [FormBuilder]})
@View({
template: `
<h1>Checkout Form (Model Driven)</h1>

View File

@ -193,7 +193,7 @@ class OrderDetailsComponent {
addItem(): void { this.service.addItemForOrder(this.order); }
}
@Component({selector: 'order-management-app', viewInjector: [DataService]})
@Component({selector: 'order-management-app', viewBindings: [DataService]})
@View({
template: `
<order-list-cmp></order-list-cmp>

View File

@ -194,7 +194,7 @@ class PersonsComponent {
}
@Component({selector: 'person-management-app', viewInjector: [DataService]})
@Component({selector: 'person-management-app', viewBindings: [DataService]})
@View({
template: `
<button (click)="switchToEditName()">Edit Full Name</button>

View File

@ -133,7 +133,7 @@ class DraftsCmp {
}
}
@Component({selector: 'inbox-app', viewInjector: [DbService]})
@Component({selector: 'inbox-app', viewBindings: [DbService]})
@View({templateUrl: "inbox-app.html", directives: [RouterOutlet, RouterLink]})
@RouteConfig([
new Route({path: '/', component: InboxCmp, as: 'inbox'}),

View File

@ -36,7 +36,7 @@ class CheckoutModel {
const creditCardValidatorBinding =
CONST_EXPR(new Binding(NgValidator, {toAlias: forwardRef(() => CreditCardValidator)}));
@Directive({selector: '[credit-card]', hostInjector: [creditCardValidatorBinding]})
@Directive({selector: '[credit-card]', bindings: [creditCardValidatorBinding]})
class CreditCardValidator {
get validator() { return CreditCardValidator.validate; }

View File

@ -1,7 +1,7 @@
import {bootstrap, NgFor, Component, View} from 'angular2/bootstrap';
import {Store, Todo, TodoFactory} from './services/TodoStore';
@Component({selector: 'todo-app', viewInjector: [Store, TodoFactory]})
@Component({selector: 'todo-app', viewBindings: [Store, TodoFactory]})
@View({templateUrl: 'todo.html', directives: [NgFor]})
class TodoApp {
todoEdit: Todo = null;

View File

@ -31,7 +31,7 @@ class RedDec {
selector: 'hello-app',
// These are services that would be created if a class in the component's
// template tries to inject them.
viewInjector: [GreetingService]
viewBindings: [GreetingService]
})
// The template for the component.
@View({