angular-cn/packages/forms/src
Paul Gschwendtner 5cecd97493 feat(forms): expand NgModel disabled type to work with strict template type checking (#34438)
NgModel internally coerces any arbitrary value that will assigned
to the `disabled` `@Input` to a boolean. This has been done to
support the common case where developers set the disabled attribute
without a value. For example:

```html
<input type="checkbox" [(ngModel)]="value" disabled>
```

This worked in View Engine without any errors because inputs were
not strictly checked. In Ivy though, developers can opt-in into
strict template type checking where the attribute would be flagged.

This is because the `NgModel#isDisabled` property type-wise only
accepts a `boolean`. To ensure that the common pattern described
above can still be used, and to reflect the actual runtime behavior,
we should add an acceptance member that makes it work without type
checking errors.

Using a coercion member means that this is not a breaking change.

PR Close #34438
2019-12-16 15:34:03 -08:00
..
directives feat(forms): expand NgModel disabled type to work with strict template type checking (#34438) 2019-12-16 15:34:03 -08:00
directives.ts refactor(forms): remove ngForm element selector (#33058) 2019-10-11 15:43:56 -07:00
form_builder.ts refactor(docs-infra): remove `linenums=false` since it is now the default (#31674) 2019-07-24 14:38:54 -07:00
form_providers.ts refactor(forms): remove ngForm element selector (#33058) 2019-10-11 15:43:56 -07:00
forms.ts refactor(forms): remove ngForm element selector (#33058) 2019-10-11 15:43:56 -07:00
model.ts docs(forms): fix grammar and add clarification to setValue docs (#33126) 2019-10-21 15:58:38 -04:00
validators.ts Revert "refactor: use isObservable provided by rxjs 6.1+ (#27668)" 2019-11-27 13:00:59 -08:00
version.ts docs: update forms with `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00