fix(forms): support unbound disabled in ngModel (#11736)

This commit is contained in:
Kara
2016-09-20 14:55:47 -07:00
committed by Alex Eagle
parent d95344430c
commit 44da4984f9
3 changed files with 68 additions and 2 deletions

View File

@ -200,7 +200,9 @@ export class NgModel extends NgControl implements OnChanges,
private _updateDisabled(changes: SimpleChanges) {
const disabledValue = changes['isDisabled'].currentValue;
const isDisabled = disabledValue != null && disabledValue != false;
const isDisabled =
disabledValue === '' || (disabledValue && disabledValue !== 'false');
resolvedPromise.then(() => {
if (isDisabled && !this.control.disabled) {