Created
July 3, 2018 19:35
-
-
Save roelofjan-elsinga/4f6c32c5c1006f93bf722d6abe0eb814 to your computer and use it in GitHub Desktop.
Dispatch an action with AngularJS in Redux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as angular from 'angular'; | |
import ngRedux from 'ng-redux'; | |
import {ADD_LANGUAGE} from "../../../app/redux/actions"; | |
angular.module("any.module", [ngRedux]) | |
.run(['$ngRedux', $ngRedux => { | |
let language = { | |
shortcode: 'en', | |
name: 'English', | |
english_name: 'English' | |
}; | |
$ngRedux.dispatch({type: ADD_LANGUAGE, value: language}); | |
}]); | |
export default "any.module"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment