1- ## ng2 -redux- form
1+ ## @ angular -redux/ form
22
3- [ ![ npm version] ( https://img.shields.io/npm/v/ng2-redux-form.svg )] ( https://www.npmjs.com/package/ng2-redux-form )
4- [ ![ npm downloads] ( https://img.shields.io/npm/dt/ng2-redux-form.svg )] ( https://www.npmjs.com/package/ng2-redux-form )
3+ [ ![ npm version] ( https://img.shields.io/npm/v/@angular-redux/form.svg )] ( https://www.npmjs.com/package/@angular-redux/form )
54
6- This library is a thin layer of connective tissue between Angular 2 forms and
5+ This library is a thin layer of connective tissue between Angular 2+ forms and
76Redux. It provides unidirectional data binding between your Redux state and
87your forms elements. It builds on existing Angular functionality like
98[ NgModel] ( https://angular.io/docs/ts/latest/api/forms/index/NgModel-directive.html )
@@ -51,7 +50,7 @@ the class that is responsible for connecting your forms to your Redux state.
5150There are two ways of doing this: either using an ` Redux.Store<T> ` object or
5251an ` NgRedux<T> ` object. There are no substantial differences between these
5352approaches, but if you are already using
54- [ ng2 -redux] ( https://github.com/angular-redux/ng2-redux ) or you wish to integrate
53+ [ @ angular -redux/store ] ( https://github.com/angular-redux/store ) or you wish to integrate
5554it into your project, then you would do something like this:
5655
5756``` typescript
@@ -70,11 +69,11 @@ it into your project, then you would do something like this:
7069export class ExampleModule {}
7170```
7271
73- Or if you are using Redux without ng2 -redux, then your bootstrap call would look
72+ Or if you are using Redux without ` @angular -redux/store ` , then your bootstrap call would look
7473more like this (substitute your own store creation code):
7574
7675``` typescript
77- import {provideReduxForms } from ' ng2 -redux- form' ;
76+ import {provideReduxForms } from ' @angular -redux/ form' ;
7877
7978const storeCreator = compose (applyMiddleware (logger ))(createStore );
8079const store = create (reducers , <MyApplicationState > {});
@@ -95,7 +94,7 @@ export class ExampleModule {}
9594```
9695
9796The essential bit of code in the above samples is the call to ` provideReduxForms(...) ` .
98- This configures ng2-form- redux and provides access to your Redux store or NgRedux
97+ This configures ` @angular- redux/form ` and provides access to your Redux store or NgRedux
9998instance. The shape of the object that ` provideReduxForms ` expects is very
10099basic:
101100
@@ -200,7 +199,7 @@ the `path` property on our first `<select>` element, it would look like this:
200199['form1', 'dependents', 0, 'type']
201200```
202201
203- From there, ` ng2 -redux- form` is able to take that path and extract the value for
202+ From there, ` @angular -redux/ form` is able to take that path and extract the value for
204203that element from the Redux state.
205204
206205#### Troubleshooting
@@ -218,14 +217,14 @@ the easy part and is unlikely to cause any problems for you. Slightly more diffi
218217is _ updating your Redux state_ when the form values change. There are two approaches
219218that you can take in order to do this.
220219
221- The first, and by far the simplest, is to use the reducer that comes with ng2 -redux- form
220+ The first, and by far the simplest, is to use the reducer that comes with ` @angular -redux/ form`
222221and uses the value supplied in ` connect ` and the form input names in order to update
223222your Redux state automatically. If you do not need to do any special processing on
224223your data when the user updates form inputs, then you should use this default reducer.
225224To use it, you need to combine it with your existing reducers like so:
226225
227226``` typescript
228- import {composeReducers , defaultFormReducer } from ' ng2 -redux- form' ;
227+ import {composeReducers , defaultFormReducer } from ' @angular -redux/ form' ;
229228
230229const reducer = composeReducers (
231230 defaultFormReducer (),
@@ -293,10 +292,10 @@ to you.
293292
294293## Examples
295294
296- The ` examples ` directory contains some examples of how to use ng2 -redux- form and
295+ The ` examples ` directory contains some examples of how to use ` @angular -redux/ form` and
297296how to connect it to your application. You may also find it useful to debug and
298297step through the examples and the unit tests to get a better understanding of how
299298the library works.
300299
301300The unit tests in ` *.test.ts ` files also contain useful examples of how to build
302- forms using ng2 -redux- form.
301+ forms using ` @angular -redux/ form` .
0 commit comments