refactor(di): removed @Parent
BREAKING CHANGE
The @Parent annotation has been removed. Use @Ancestor instead.
@Parent was used to enforce a particular DOM structure (e.g., a pane component is a direct child of the tabs component).
DI is not the right mechanism to do it. We should enforce it using schema instead.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Directive, LifecycleEvent, Attribute, Parent} from 'angular2/angular2';
|
||||
import {Directive, LifecycleEvent, Attribute, Ancestor} from 'angular2/angular2';
|
||||
|
||||
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
|
||||
|
||||
@@ -73,7 +73,7 @@ export class MdInput {
|
||||
mdChange: EventEmitter;
|
||||
mdFocusChange: EventEmitter;
|
||||
|
||||
constructor(@Attribute('value') value: string, @Parent() container: MdInputContainer,
|
||||
constructor(@Attribute('value') value: string, @Ancestor() container: MdInputContainer,
|
||||
@Attribute('id') id: string) {
|
||||
// TODO(jelbourn): Remove this when #1402 is done.
|
||||
this.yes = true;
|
||||
@@ -111,7 +111,7 @@ export class MdInput {
|
||||
export class MdTextarea extends MdInput {
|
||||
constructor(
|
||||
@Attribute('value') value: string,
|
||||
@Parent() container: MdInputContainer,
|
||||
@Ancestor() container: MdInputContainer,
|
||||
@Attribute('id') id: string) {
|
||||
super(value, container, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user