Skip to content

Instantly share code, notes, and snippets.

@roelofjan-elsinga
Created July 3, 2018 19:35
Show Gist options
  • Save roelofjan-elsinga/4f6c32c5c1006f93bf722d6abe0eb814 to your computer and use it in GitHub Desktop.
Save roelofjan-elsinga/4f6c32c5c1006f93bf722d6abe0eb814 to your computer and use it in GitHub Desktop.
Dispatch an action with AngularJS in Redux
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