cleanup(di): renamed viewInjector and hostInjector
BREAKING CHANGE Replace viewInjector with viewBindings Replace hostInjector with bindings
This commit is contained in:
@ -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({
|
||||
|
@ -12,7 +12,7 @@ import {isPresent} from 'angular2/src/facade/lang';
|
||||
|
||||
@Component({
|
||||
selector: 'demo-app',
|
||||
viewInjector: [MdDialog],
|
||||
viewBindings: [MdDialog],
|
||||
})
|
||||
@View({
|
||||
templateUrl: './demo_app.html',
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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'}),
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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({
|
||||
|
Reference in New Issue
Block a user