a1-redux
Angular 1.x with redux the right way.
TODO
- add unit test on browser.
- support register library with propTypes checking.
- unit test for store.register and handle action.
- container directive
- example todo
How to use the library? Where is the document?
For now, please check the unit test in the test
directory.
Container directive
** The goal is separating between the presentation and the state/logic control. **
Potential setup
app;app;
Is it too cumbersome? and duplicated?
OR we can do the following:
Start with presentation: file directive-present.js
:
const directiveFactory = '$service1' '$service2' { return _propTypes_: hello: PropTypesstring link: $scope $element $attrs // link implementation... template: '<div>present directive {{hello}}</div>' ;};
Then the container: file directive-container.js
;;; const mapStateToScope = attr1 attr2; const mapDispatchToScope = mapStateToScope mapDispatchToScope directivePresent;
Then put in the application: file app.js
;; let app = ;app;//... more ...