Skip to content

Commit ae1b3c4

Browse files
author
Shaneeb Kamran
committed
fix(uiSref): add absolute to allowed transition options
1 parent 40e7a4f commit ae1b3c4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/stateDirectives.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function stateContext(el) {
7878
*/
7979
$StateRefDirective.$inject = ['$state', '$timeout'];
8080
function $StateRefDirective($state, $timeout) {
81-
var allowedOptions = ['location', 'inherit', 'reload'];
81+
var allowedOptions = ['location', 'inherit', 'reload', 'absolute'];
8282

8383
return {
8484
restrict: 'A',

test/stateDirectivesSpec.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ describe('uiStateRef', function() {
366366
describe('transition options', function() {
367367

368368
beforeEach(inject(function($rootScope, $compile, $state) {
369-
el = angular.element('<a ui-sref="contacts.item.detail({ id: contact.id })" ui-sref-opts="{ reload: true, notify: true }">Details</a>');
369+
el = angular.element('<a ui-sref="contacts.item.detail({ id: contact.id })" ui-sref-opts="{ reload: true, absolute: true, notify: true }">Details</a>');
370370
scope = $rootScope;
371371
scope.contact = { id: 5 };
372372

@@ -385,6 +385,7 @@ describe('uiStateRef', function() {
385385
$timeout.flush();
386386

387387
expect(transitionOptions.reload).toEqual(true);
388+
expect(transitionOptions.absolute).toEqual(true);
388389
expect(transitionOptions.notify).toBeUndefined();
389390
}));
390391
});

0 commit comments

Comments
 (0)