Commit Graph

91 Commits

Author SHA1 Message Date
Frederik Schlemmer 1e02cd9961 docs: Fixes typo in FormArray (#26031)
PR Close #26031
2018-09-24 09:14:07 -07:00
Pete Bacon Darwin 7d39bc68fb docs(forms): move extended text to @usageNotes (#26039)
Headings are not allowed in the basic description block.

PR Close #26039
2018-09-24 09:11:02 -07:00
Pete Bacon Darwin 927323f24e docs: add missing `@ngModule` tags (#25734)
PR Close #25734
2018-09-19 16:18:24 -07:00
Brandon Roberts a9a81f91cf docs(forms): update form apis based on review feedback (#25724)
PR Close #25724
2018-09-19 16:09:00 -07:00
Brandon Roberts 07c10e2844 docs(forms): update API reference for forms interfaces and abstract classes (#25724)
PR Close #25724
2018-09-19 16:09:00 -07:00
Judy Bogart dd5e35ee67 docs: add ngmodule api doc (#25618)
PR Close #25618
2018-09-19 10:40:58 -07:00
Alex Eagle cbbad1b791 refactor(ivy): pre-factor: set explicit type parameters for ModuleWithProviders (#25970)
Ivy depends on having the generic type token later when reading the ModuleWithProviders from a .d.ts file.

PR Close #25970
2018-09-18 13:28:44 -07:00
George Wilde ddd3bf83c7 docs(forms): change documentation of the FormGroup patchValue method (#25901)
Improve the grammar of the description to make it more readable.
PR Close #25901
2018-09-18 13:08:05 -07:00
Brandon Roberts abd29f5049 docs(forms): update API reference for reactive and template-driven forms modules (#25687)
PR Close #25687
2018-08-31 13:37:40 -07:00
Alan 3ba5220839 refactor(forms): `ngForm` element selector has been deprecated in favor of `ng-form` (#23721)
This has been deprecated to keep selector consistent with other core Angular selectors.  As element selectors are in kebab-case.

 Now deprecated:
 ```
 <ngForm #myForm="ngForm">
 ```

 After:
 ```
 <ng-form #myForm="ngForm">
 ```

You can also choose to supress this warnings by providing a config for `FormsModule` during import:

```ts
imports: [
 FormsModule.withConfig({warnOnDeprecatedNgFormSelector: 'never'});
]

Closes: #23678

PR Close #23721
2018-08-02 08:34:43 -07:00
denjamal 3f6fc00d73 docs(forms): fix incorrect variables naming in the comments (#25150)
PR Close #25150
2018-07-31 11:42:15 -07:00
Alex Rickabaugh 60aeee7abf feat(ivy): selector side of ModuleWithProviders via type metadata (#24862)
Within an @NgModule it's common to include in the imports a call to
a ModuleWithProviders function, for example RouterModule.forRoot().
The old ngc compiler was able to handle this pattern because it had
global knowledge of metadata of not only the input compilation unit
but also all dependencies.

The ngtsc compiler for Ivy doesn't have this knowledge, so the
pattern of ModuleWithProviders functions is more difficult. ngtsc
must be able to determine which module is imported via the function
in order to expand the selector scope and properly tree-shake
directives and pipes.

This commit implements a solution to this problem, by adding a type
parameter to ModuleWithProviders through which the actual module
type can be passed between compilation units.

The provider side isn't a problem because the imports are always
copied directly to the ngInjectorDef.

PR Close #24862
2018-07-20 11:48:35 -07:00
Brandon Roberts 80a74b450a docs(forms): update form builder API reference (#24693)
PR Close #24693
2018-07-12 16:38:26 -04:00
Brandon Roberts 05e3e4d71e docs(forms): update API reference for form validators (#24734)
PR Close #24734
2018-07-10 18:52:40 -07:00
Tyler Akins 81a9db2b0a docs(forms): added missing backtick (#24451)
Fixed trivial markdown problem with a missing backtick.

PR Close #24451
2018-07-10 18:51:08 -07:00
Rado Kirov c95437f15d build(bazel): Turning on strictPropertyInitialization for Angular. (#24572)
All errors for existing fields have been detected and suppressed with a
`!` assertion.

Issue/24571 is tracking proper clean up of those instances.

One-line change required in ivy/compilation.ts, because it appears that
the new syntax causes tsickle emitted node to no longer track their
original sourceFiles.

PR Close #24572
2018-06-25 07:57:13 -07:00
Brandon Roberts 5b76f04b7f docs: More edits (#24255)
PR Close #24255
2018-06-19 10:53:13 -07:00
Brandon Roberts a57825acf3 docs: More form control API edits (#24255)
PR Close #24255
2018-06-19 10:53:13 -07:00
Brandon Roberts efc7639352 docs: Added multicast to observable descriptions (#24255)
PR Close #24255
2018-06-19 10:53:13 -07:00
Brandon Roberts 3e26cabe02 docs: formatting (#24255)
PR Close #24255
2018-06-19 10:53:13 -07:00
Brandon Roberts 9d114c052a docs: More form control API references fixes (#24255)
PR Close #24255
2018-06-19 10:53:13 -07:00
Brandon Roberts 43e61c25e1 docs(docs-infra): Update with review changes (#24255)
PR Close #24255
2018-06-19 10:53:13 -07:00
Brandon Roberts 4e1493a1d6 docs(forms): update API reference for FormControl (#24255)
PR Close #24255
2018-06-19 10:53:13 -07:00
Trotyl 9367e91402 fix(forms): properly handle special properties in FormGroup.get (#22249)
closes #17195

PR Close #22249
2018-06-05 18:28:13 -07:00
Johnson Lin b86d4dee4d docs(forms): fix API doc (#24210)
closes #24090

PR Close #24210
2018-05-30 17:06:12 -07:00
swseverance fe3679a356 style: remove empty comments (#23404)
PR Close #23404
2018-05-10 15:48:13 -07:00
Pete Bacon Darwin 4b96a58c5a docs: remove all deprecated `@stable` jsdoc tags (#23210)
These are no longer needed as stable docs are computed as those that
do not have `@experimental` or `@deprecated` tags.

PR Close #23210
2018-04-10 21:49:32 -07:00
Pete Bacon Darwin 92821e338b docs(forms): remove unnecessary `{@link Injector}` jsdoc tags (#23186)
Inline code blocks are automatically linked, if possible, to their API
page.

PR Close #23186
2018-04-05 09:27:29 -07:00
Pete Bacon Darwin 1aef4df127 docs(forms): migrate `@whatItDoes` tags to the description (#23186)
We get the overview for the doc by splitting off the first
paragraph.

PR Close #23186
2018-04-05 09:27:29 -07:00
Pete Bacon Darwin 0a065bbdcf docs(forms): migrate deprecated `@howToUse` tags (#23186)
In this case they have been converted to `@description` tags.

PR Close #23186
2018-04-05 09:27:29 -07:00
Dirk Luijk 23cc3ef2eb fix(forms): improve error message for invalid value accessors (#22731)
Signed-off-by: Dirk Luijk <mail@dirkluijk.nl>

PR Close #22731
2018-04-04 08:20:55 -07:00
Igor Minar b43f8bc7d3 feat(core): upgrade rxjs to 6.0.0-alpha.4 (#22573)
PR Close #22573
2018-03-19 21:51:51 -07:00
Kara Erickson 8fb34bcd43 refactor(forms): deprecate ngModel usage on same field as formControl (#22633)
Support for using the `ngModel` input property and `ngModelChange`
event with reactive form directives has been deprecated in
Angular v6 and will be removed in Angular v7.

Now deprecated:
```html
<input [formControl]="control" [(ngModel)]="value">
```

```ts
this.value = 'some value';
```

This has been deprecated for a few reasons. First, developers have
found this pattern confusing. It seems like the actual `ngModel`
directive is being used, but in fact it's an input/output property
named `ngModel` on the reactive form directive that simply approximates
(some of) its behavior. Specifically, it allows getting/setting the
value and intercepting value events. However, some of `ngModel`'s other
features - like delaying updates with`ngModelOptions` or exporting the
directive - simply don't work, which has understandably caused some
confusion.

In addition, this pattern mixes template-driven and reactive forms
strategies, which we generally don't recommend because it doesn't take
advantage of the full benefits of either strategy. Setting the value in
the template violates the template-agnostic principles behind reactive
forms, whereas adding a FormControl/FormGroup layer in the class removes
the convenience of defining forms in the template.

To update your code before v7, you'll want to decide whether to stick
with reactive form directives (and get/set values using reactive forms
patterns) or switch over to template-driven directives.

After (choice 1 - use reactive forms):

```html
<input [formControl]="control">
```

```ts
this.control.setValue('some value');
```

After (choice 2 - use template-driven forms):

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

```ts
this.value = 'some value';
```

You can also choose to silence this warning by providing a config for
`ReactiveFormsModule` at import time:

```ts
imports: [
  ReactiveFormsModule.withConfig({warnOnNgModelWithFormControl: 'never'});
]
```

Alternatively, you can choose to surface a separate warning for each
instance of this pattern with a config value of `"always"`. This may
help to track down where in the code the pattern is being used as the
code is being updated.

Note: `warnOnNgModelWithFormControl` is set up as deprecated so that it
can be removed in v7 when it is no longer needed. This will not display
properly in API docs yet because dgeni doesn't yet support deprecating
properties in object literals, but we have an open issue to resolve the
discrepancy here: https://github.com/angular/angular/issues/22640.

PR Close #22633
2018-03-07 20:47:53 -08:00
Fabian Wiles e86b64b620 feat(forms): allow markAsPending to emit events (#20212)
closes #17958

BREAKING CHANGE:
- `AbstractControl#statusChanges` now emits an event of `'PENDING'` when you call `AbstractControl#markAsPending`
- Previously it did not emit an event when you called `markAsPending`
- To migrate you would need to ensure that if you are filtering or checking events from `statusChanges` that you account for the new event when calling `markAsPending`

PR Close #20212
2018-02-22 11:15:33 -08:00
Philip Pham 3e6a86fb0a fix(forms): set state before emitting a value from ngModelChange (#21514)
Closes #21513.

PR Close #21514
2018-02-21 15:59:33 -08:00
Pete Bacon Darwin 7007f51c35 feat(aio): first pass API docs redesign (#21874)
Includes:

* display ToC for API docs
* update dgeni-packages to 0.24.1
* add floating sidebar in API docs
* add breadcrumbs and structured data for Google crawler
* improved rendering of method overloads
* properties rendered in a table
* params rendered with docs
* removal of outdated "infobox" from all API docs

PR Close #21874
2018-02-09 13:05:16 -08:00
Miško Hevery cf8d512e43 Revert "fix(forms): set state before emitting a value from ngModelChange (#21514)"
This reverts commit 9744a1c966.
2018-02-09 10:11:23 -08:00
Philip Pham 9744a1c966 fix(forms): set state before emitting a value from ngModelChange (#21514)
Closes #21513.

PR Close #21514
2018-02-07 12:05:43 -08:00
Kevin Fahy 0bcfae7cac fix(forms): prevent event emission on enable/disable when emitEvent is false (#12366) (#21018)
Previously, the emitEvent flag was only checked when emitting on the current control.
Thus, if  the control was part of a hierarchy, events were emitted on the parent and the childrens.
This fixes the issue by properly passing the emitEvent flag to both parent and childrens.

Fixes #12366

PR Close #21018
2018-02-07 12:05:26 -08:00
Phil McCloghry-Laing 140e7c00d1 fix(forms): make Validators.email support optional controls (#20869)
Bring email validator in line with other validators so that empty values are ignored.

PR Close #20869
2018-02-07 12:05:08 -08:00
harunurhan 941e88ff79 feat(forms): multiple validators for array method (#20766)
Change array method signature so that array of validator and/or async
validatior functions can be passed.

Fixes #20665

PR Close #20766
2018-02-07 12:04:48 -08:00
Trotyl 2707012181 fix(forms): publish missing types (#19941)
PR Close #19941
2018-02-06 08:02:15 -08:00
Kara Erickson b4cd27979b fix(forms): inserting and removing controls should work in re-bound form arrays (#21822)
Closes #21501

PR Close #21822
2018-01-29 16:11:41 -08:00
Oussama Ben Brahim 170885c51b fix(forms): allow FormBuilder to create controls with any formState type (#20917)
Align formState type in FormBuilder#control with FormControl#constructor

Fixes #20368

PR Close #20917
2018-01-25 22:17:43 -08:00
ghetolay 54bf179888 feat(forms): handle string with and without line boundary on pattern validator (#19256)
PR Close #19256
2018-01-16 07:11:54 -08:00
Kapunahele Wong a66cd526c3 docs(forms): add text about min() and max() as functions (#21110)
PR Close #21110
2017-12-22 21:36:46 -08:00
Chuck Jazdzewski d213a20dfc fix(forms): avoid producing an error with hostBindingTypeCheck
Using the default value accessor no longer produces errors when
used in combination with fullTemplateTypeCheck and hostBindingTypeCheck.

Fixes: #19905
2017-12-15 07:52:52 -08:00
Fabian Wiles d41d2c460a feat(forms): allow nulls on setAsyncValidators (#20327)
closes #20296

PR Close #20327
2017-12-07 13:34:12 -08:00
WilliamKoza 35977e3830 fix(forms): Broken link NG_VALIDATORS replace by an example (#15480)
PR Close #15480
2017-12-05 21:53:12 -08:00
Kara Erickson 69c53c3e03 fix(forms): updateOn should check if change occurred (#20358)
Fixes #20259.

PR Close #20358
2017-11-17 16:28:46 -06:00