fix(forms): fix conflicting getter name (#11081)

This commit is contained in:
Kara
2016-08-25 14:56:31 -07:00
committed by Victor Berchet
parent cbe0976426
commit ce08982f78
5 changed files with 20 additions and 8 deletions
@@ -65,7 +65,7 @@ export class NgModel extends NgControl implements OnChanges,
viewModel: any;
@Input() name: string;
@Input() disabled: boolean;
@Input('disabled') isDisabled: boolean;
@Input('ngModel') model: any;
@Input('ngModelOptions') options: {name?: string, standalone?: boolean};
@@ -83,7 +83,7 @@ export class NgModel extends NgControl implements OnChanges,
ngOnChanges(changes: SimpleChanges) {
this._checkForErrors();
if (!this._registered) this._setUpControl();
if ('disabled' in changes) {
if ('isDisabled' in changes) {
this._updateDisabled(changes);
}
@@ -160,7 +160,7 @@ export class NgModel extends NgControl implements OnChanges,
}
private _updateDisabled(changes: SimpleChanges) {
const disabledValue = changes['disabled'].currentValue;
const disabledValue = changes['isDisabled'].currentValue;
const isDisabled = disabledValue != null && disabledValue != false;
resolvedPromise.then(() => {
@@ -82,7 +82,7 @@ export class FormControlDirective extends NgControl implements OnChanges {
@Output('ngModelChange') update = new EventEmitter();
@Input('disabled')
set disabled(isDisabled: boolean) { ReactiveErrors.disabledAttrWarning(); }
set isDisabled(isDisabled: boolean) { ReactiveErrors.disabledAttrWarning(); }
constructor(@Optional() @Self() @Inject(NG_VALIDATORS) private _validators:
/* Array<Validator|Function> */ any[],
@@ -106,7 +106,7 @@ export class FormControlName extends NgControl implements OnChanges, OnDestroy {
@Input('ngModel') model: any;
@Output('ngModelChange') update = new EventEmitter();
@Input('disabled')
set disabled(isDisabled: boolean) { ReactiveErrors.disabledAttrWarning(); }
set isDisabled(isDisabled: boolean) { ReactiveErrors.disabledAttrWarning(); }
constructor(
@Optional() @Host() @SkipSelf() private _parent: ControlContainer,