Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(input): make sure injected NgControl belongs to the input #3700

Merged
merged 1 commit into from
Mar 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/lib/input/input-container.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import {
Component,
Input,
Directive,
AfterContentInit,
Component,
ContentChild,
ContentChildren,
Directive,
ElementRef,
QueryList,
ViewEncapsulation,
EventEmitter,
Input,
Optional,
Output,
EventEmitter,
Renderer
QueryList,
Renderer,
Self,
ViewEncapsulation
} from '@angular/core';
import {coerceBooleanProperty} from '../core';
import {NgControl} from '@angular/forms';
import {getSupportedInputTypes} from '../core/platform/features';
import {
MdInputContainerUnsupportedTypeError,
MdInputContainerPlaceholderConflictError,
MdInputContainerDuplicatedHintError,
MdInputContainerMissingMdInputError
MdInputContainerMissingMdInputError,
MdInputContainerPlaceholderConflictError,
MdInputContainerUnsupportedTypeError
} from './input-container-errors';


Expand Down Expand Up @@ -181,7 +182,7 @@ export class MdInputDirective {

constructor(private _elementRef: ElementRef,
private _renderer: Renderer,
@Optional() public _ngControl: NgControl) {
@Optional() @Self() public _ngControl: NgControl) {

// Force setter to be called in case id was not specified.
this.id = this.id;
Expand Down