Skip to content
This repository was archived by the owner on Sep 20, 2020. It is now read-only.

Commit 231a4e5

Browse files
Release 0.0.9
1 parent e3246c5 commit 231a4e5

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ui-router-extras",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"authors": [
55
"Chris Thielen <[email protected]>"
66
],

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Chris Thielen",
33
"name": "ui-router-extras",
4-
"version": "0.0.8",
4+
"version": "0.0.9",
55
"description": "UI-Router Extras",
66
"homepage": "http://christopherthielen.github.io/ui-router-extras/",
77
"dependencies": {},

release/ct-ui-router-extras.js

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
;(function( window, undefined ){
2-
'use strict';
1+
/**
2+
* UI-Router Extras
3+
* @version v0.0.9
4+
* @link http://christopherthielen.github.io/ui-router-extras/
5+
* @license MIT License, http://www.opensource.org/licenses/MIT
6+
*/
37

8+
(function (window, angular, undefined) {
49
angular.module("ct.ui.router.extras", [ 'ui.router' ]);
510

611

@@ -190,9 +195,10 @@ function inherit(parent, extra) {
190195
$rootScope.$on("$stateChangeSuccess", function (event, toState, toParams, fromState, fromParams) {
191196
var deepStateStatus = computeDeepStateStatus(toState);
192197
if (deepStateStatus) {
198+
var name = toState.name;
193199
angular.forEach(lastSubstate, function (deepState, redirectState) {
194-
if (toState.name == deepState || toState.name.indexOf(redirectState + ".") != -1) {
195-
lastSubstate[redirectState] = toState.name;
200+
if (name == redirectState || name.indexOf(redirectState + ".") != -1) {
201+
lastSubstate[redirectState] = name;
196202
lastParams[redirectState] = angular.copy(toParams);
197203
}
198204
});
@@ -1129,7 +1135,13 @@ function debugViewsAfterSuccess($log, currentState, $state) {
11291135
// TODO: analyze this. I'm calling $urlRouter.sync() in two places for retry-initial-transition.
11301136
// TODO: I should only need to do this once. Pick the better place and remove the extra resync.
11311137
initPromise().then(function retryInitialState() {
1132-
$timeout(function() { $urlRouter.sync(); } );
1138+
$timeout(function() {
1139+
if ($state.transition) {
1140+
$state.transition.then($urlRouter.sync, $urlRouter.sync);
1141+
} else {
1142+
$urlRouter.sync();
1143+
}
1144+
});
11331145
});
11341146
}
11351147
init();
@@ -1178,9 +1190,9 @@ function($rootScope, $state) {
11781190
get: function(memoName) {
11791191
return memoName ? memos[memoName] : previous;
11801192
},
1181-
go: function(memoName) {
1193+
go: function(memoName, options) {
11821194
var to = $previousState.get(memoName);
1183-
return $state.go(to.state, to.params);
1195+
return $state.go(to.state, to.params, options);
11841196
},
11851197
memo: function(memoName) {
11861198
memos[memoName] = previous;
@@ -1197,5 +1209,4 @@ angular.module('ct.ui.router.extras').run(['$previousState', function($previousS
11971209
// Inject $previousState so it can register $rootScope events
11981210
}]);
11991211

1200-
1201-
}(window));
1212+
})(window, window.angular);

0 commit comments

Comments
 (0)