cleanup(DI): clean up visibility decorators
BREAKING CHANGE:
Replace @Ancestor() with @Host() @SkipSelf()
Replace @Unbounded() wwith @SkipSelf()
Replace @Ancestor({self:true}) with @Host()
Replace @Unbounded({self:true}) with nothing
Replace new AncestorMetadata() with [new HostMetadata(), new SkipSelfMetadata()]
Replace new UnboundedMetadata() with new SkipSelfMetadata()
Replace new Ancestor({self:true}) with new HostMetadata()
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {Directive, LifecycleEvent} from 'angular2/annotations';
|
||||
import {Inject, Ancestor, forwardRef, Binding} from 'angular2/di';
|
||||
import {Inject, Host, SkipSelf, forwardRef, Binding} from 'angular2/di';
|
||||
import {List, ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
@@ -57,7 +57,7 @@ const controlGroupBinding =
|
||||
})
|
||||
export class NgControlGroup extends ControlContainer {
|
||||
_parent: ControlContainer;
|
||||
constructor(@Ancestor() _parent: ControlContainer) {
|
||||
constructor(@Host() @SkipSelf() _parent: ControlContainer) {
|
||||
super();
|
||||
this._parent = _parent;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import {List, StringMap} from 'angular2/src/facade/collection';
|
||||
|
||||
import {QueryList} from 'angular2/core';
|
||||
import {Query, Directive, LifecycleEvent} from 'angular2/annotations';
|
||||
import {forwardRef, Ancestor, Binding, Inject} from 'angular2/di';
|
||||
import {forwardRef, Host, SkipSelf, Binding, Inject} from 'angular2/di';
|
||||
|
||||
import {ControlContainer} from './control_container';
|
||||
import {NgControl} from './ng_control';
|
||||
@@ -88,7 +88,7 @@ export class NgControlName extends NgControl {
|
||||
_added = false;
|
||||
|
||||
// Scope the query once https://github.com/angular/angular/issues/2603 is fixed
|
||||
constructor(@Ancestor() parent: ControlContainer,
|
||||
constructor(@Host() @SkipSelf() parent: ControlContainer,
|
||||
@Query(NgValidator) ngValidators: QueryList<NgValidator>) {
|
||||
super();
|
||||
this._parent = parent;
|
||||
|
||||
@@ -3,7 +3,7 @@ import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
|
||||
import {QueryList} from 'angular2/core';
|
||||
import {Query, Directive, LifecycleEvent} from 'angular2/annotations';
|
||||
import {forwardRef, Ancestor, Binding} from 'angular2/di';
|
||||
import {forwardRef, Binding} from 'angular2/di';
|
||||
|
||||
import {NgControl} from './ng_control';
|
||||
import {Control} from '../model';
|
||||
|
||||
@@ -3,7 +3,7 @@ import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
|
||||
import {QueryList} from 'angular2/core';
|
||||
import {Query, Directive, LifecycleEvent} from 'angular2/annotations';
|
||||
import {forwardRef, Ancestor, Binding} from 'angular2/di';
|
||||
import {forwardRef, Binding} from 'angular2/di';
|
||||
|
||||
import {NgControl} from './ng_control';
|
||||
import {Control} from '../model';
|
||||
|
||||
Reference in New Issue
Block a user