mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(input): make sure injected NgControl belongs to the input (#3700)
This commit is contained in:
@@ -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';
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user