Skip to content

Commit 3e5aae9

Browse files
authored
Merge pull request #148 from cloudnc/doc/typos
doc: fix typos
2 parents 00aea19 + 3853c46 commit 3e5aae9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Really small bundle (< 15kb) and no module to setup. Pick the class you need and
88

99
Built for **all your different forms** (tiny to extra large!), this library will deal with all the boilerplate required to use a [`ControlValueAccessor`](https://blog.angularindepth.com/never-again-be-confused-when-implementing-controlvalueaccessor-in-angular-forms-93b9eee9ee83) internally and let you manage your most complex forms in a fast and easy way.
1010

11-
From creating a small custom input, to breaking down a form into multiple sub components, `ngx-sub-form` will give you a lot of functionalities like better type safety to survive futur refactors (from both `TS` and `HTML`), remapping external data to the shape you need within your form, access nested errors and many more. It'll also save you from passing a `FormGroup` to an `@Input` :pray:.
11+
From creating a small custom input, to breaking down a form into multiple sub components, `ngx-sub-form` will give you a lot of functionalities like better type safety to survive future refactors (from both `TS` and `HTML`), remapping external data to the shape you need within your form, access nested errors and many more. It'll also save you from passing a `FormGroup` to an `@Input` :pray:.
1212

1313
It also works particularly well with polymorphic data structures.
1414

@@ -123,7 +123,7 @@ export interface OneListingForm {
123123
})
124124
export class ListingComponent extends NgxAutomaticRootFormComponent<OneListing, OneListingForm> {
125125
// as we're renaming the input, it'd be impossible for ngx-sub-form to guess
126-
// the name of your input to then check within the `ngOnChanges` hook wheter
126+
// the name of your input to then check within the `ngOnChanges` hook whether
127127
// it has been updated or not
128128
// another solution would be to ask you to use a setter and call a hook but
129129
// this is too verbose, that's why we created a decorator `@DataInput`
@@ -203,9 +203,9 @@ _Note the presence of disabled, this is an optional input provided by both `NgxR
203203
Differences between:
204204

205205
- `NgxRootFormComponent`: Will never emit the form value automatically when it changes, to emit the value you'll have to call the method `manualSave` when needed
206-
- `NgxAutomaticRootFormComponent`: Will emit the form value as soon as there's a change. It's possible to customize the emission rate by overidding the `handleEmissionRate` method
206+
- `NgxAutomaticRootFormComponent`: Will emit the form value as soon as there's a change. It's possible to customize the emission rate by overriding the `handleEmissionRate` method
207207

208-
The method `handleEmissionRate` is available accross **all** the classes that `ngx-sub-form` offers. It takes an observable as input and expect another observable as output. One common case is to simply [`debounce`](http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-debounce) the emission. If that's what you want to do, instead of manipulating the observable chain yourself you can just do:
208+
The method `handleEmissionRate` is available across **all** the classes that `ngx-sub-form` offers. It takes an observable as input and expect another observable as output. One common case is to simply [`debounce`](http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-debounce) the emission. If that's what you want to do, instead of manipulating the observable chain yourself you can just do:
209209

210210
```ts
211211
// src/readme/handle-emission-rate.ts#L6-L9
@@ -259,7 +259,7 @@ _Simplified from the original example into src folder to keep the example as min
259259

260260
### Remapping Data
261261

262-
It is a frequent pattern to have the data that you're trying to modify in a format that is incovenient to the angular forms structural constraints. For this reason, `ngx-form-component` offers a separate class `NgxSubFormRemapComponent`
262+
It is a frequent pattern to have the data that you're trying to modify in a format that is inconvenient to the angular forms structural constraints. For this reason, `ngx-form-component` offers a separate class `NgxSubFormRemapComponent`
263263
which will require you to define two interfaces:
264264

265265
- One to model the data going into the form
@@ -534,7 +534,7 @@ export class CrewMemberComponent extends NgxSubFormComponent<CrewMember> {
534534

535535
**Properties**
536536

537-
- `emitNullOnDestroy`: By default is set to `true` for `NgxSubFormComponent`, `NgxSubFormRemapComponent` and to `false` for `NgxRootFormComponent` and `NgxAutomaticRootFormComponent`. When set to `true`, if the sub form component is being destroyed, it will emit one last value: `null`. It might be useful to set it to `false` for e.g. when you've got a form accross multiple tabs and once a part of the form is filled you want to destroy it
537+
- `emitNullOnDestroy`: By default is set to `true` for `NgxSubFormComponent`, `NgxSubFormRemapComponent` and to `false` for `NgxRootFormComponent` and `NgxAutomaticRootFormComponent`. When set to `true`, if the sub form component is being destroyed, it will emit one last value: `null`. It might be useful to set it to `false` for e.g. when you've got a form across multiple tabs and once a part of the form is filled you want to destroy it
538538
- `emitInitialValueOnInit`: By default is set to `true` for `NgxSubFormComponent`, `NgxSubFormRemapComponent` and to `false` for `NgxRootFormComponent` and `NgxAutomaticRootFormComponent`. When set to `true`, the sub form component will emit the first value straight away (default one unless the component above as a value already set on the `formControl`)
539539

540540
**Hooks**

src/readme/listing.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface OneListingForm {
2929
})
3030
export class ListingComponent extends NgxAutomaticRootFormComponent<OneListing, OneListingForm> {
3131
// as we're renaming the input, it'd be impossible for ngx-sub-form to guess
32-
// the name of your input to then check within the `ngOnChanges` hook wheter
32+
// the name of your input to then check within the `ngOnChanges` hook whether
3333
// it has been updated or not
3434
// another solution would be to ask you to use a setter and call a hook but
3535
// this is too verbose, that's why we created a decorator `@DataInput`

0 commit comments

Comments
 (0)