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

Commit

Permalink
fix(extras): restore ie8 compatibility due to reserved words
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Dillender committed Feb 5, 2015
1 parent 1164b56 commit c25346d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/dsr.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ angular.module('ct.ui.router.extras.dsr').service("$deepStateRedirect", [ '$root
dsrCfg = angular.extend(dsrCfg, declaration);
}

if (angular.isString(dsrCfg.default)) {
dsrCfg.default = { state: dsrCfg.default };
if (angular.isString(dsrCfg['default'])) {
dsrCfg['default'] = { state: dsrCfg['default'] };
}

if (!dsrCfg.fn) {
Expand Down Expand Up @@ -104,11 +104,11 @@ angular.module('ct.ui.router.extras.dsr').service("$deepStateRedirect", [ '$root

$rootScope.$on("$stateChangeStart", function (event, toState, toParams, fromState, fromParams) {
var cfg = getConfig(toState);
if (ignoreDsr || (computeDeepStateStatus(toState) !== REDIRECT) && !cfg.default) return;
if (ignoreDsr || (computeDeepStateStatus(toState) !== REDIRECT) && !cfg['default']) return;
// We're changing directly to one of the redirect (tab) states.
// Get the DSR key for this state by calculating the DSRParams option
var key = getParamsString(toParams, cfg.params);
var redirect = lastSubstate[toState.name][key] || cfg.default;
var redirect = lastSubstate[toState.name][key] || cfg['default'];
if (!redirect) return;

// we have a last substate recorded
Expand Down
2 changes: 1 addition & 1 deletion src/previous.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ angular.module('ct.ui.router.extras.previous', [ 'ct.ui.router.extras.core', 'ct
previous = $transition$.from;
}

$transition$.promise.then(commit).catch(revert);
$transition$.promise.then(commit)['catch'](revert);
function commit() { lastPrevious = null; }
function revert() { previous = lastPrevious; }
});
Expand Down

0 comments on commit c25346d

Please sign in to comment.