Skip to content

Commit

Permalink
- Listen to $stateChangeSuccess rather than $locationChangeSuccess
Browse files Browse the repository at this point in the history
  • Loading branch information
neilff committed Feb 25, 2016
1 parent b7aef48 commit f7a5859
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
test
src
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-ui-router",
"version": "0.4.4",
"version": "0.5.0",
"description": "Redux middleware for use with Angular UI Router",
"main": "./lib/index.js",
"scripts": {
Expand All @@ -17,14 +17,12 @@
"author": "Neil Fenton (neilff)",
"license": "ISC",
"dependencies": {
"babel": "5.8.21",
"redux": "3.0.0",
"redux-actions": "^0.8.0"
"redux": "^3.0.0"
},
"devDependencies": {
"babel": "5.8.21",
"babel-core": "5.6.15",
"babel-eslint": "3.1.20",
"babel-loader": "5.3.1",
"chai": "3.0.0",
"eslint": "0.24.0",
"mocha": "2.2.5",
Expand All @@ -34,7 +32,7 @@
"sinon-as-promised": "4.0.0"
},
"peerDependencies": {
"angular": "1.4.x",
"angular": "^1.4.x",
"angular-ui-router": "^0.2.15"
}
}
4 changes: 2 additions & 2 deletions src/router-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
export default function RouterListener($rootScope, $urlRouter, $stateParams, ngUiStateChangeActions) {
$rootScope.$on('$stateChangeStart', ngUiStateChangeActions.onStateChangeStart);

$rootScope.$on('$locationChangeSuccess', () => {
$rootScope.$on('$stateChangeSuccess', () => {
ngUiStateChangeActions.onStateChangeSuccess();
});

const unsubcribeStateChangeListener = $rootScope.$on('$stateChangeSuccess', () => {
const unsubcribeStateChangeListener = $rootScope.$on('$locationChangeSuccess', () => {
ngUiStateChangeActions.onStateChangeSuccess();
unsubcribeStateChangeListener();
});
Expand Down

0 comments on commit f7a5859

Please sign in to comment.