File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1091,7 +1091,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
1091
1091
* - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the
1092
1092
* first parameter, then the constructed href url will be built from the first navigable ancestor (aka
1093
1093
* ancestor with a valid url).
1094
- * - **`inherit`** - {boolean=false }, If `true` will inherit url parameters from current url.
1094
+ * - **`inherit`** - {boolean=true }, If `true` will inherit url parameters from current url.
1095
1095
* - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
1096
1096
* defines which state to be relative from.
1097
1097
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
@@ -1101,7 +1101,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
1101
1101
$state . href = function href ( stateOrName , params , options ) {
1102
1102
options = extend ( {
1103
1103
lossy : true ,
1104
- inherit : false ,
1104
+ inherit : true ,
1105
1105
absolute : false ,
1106
1106
relative : $state . $current
1107
1107
} , options || { } ) ;
Original file line number Diff line number Diff line change @@ -649,7 +649,7 @@ describe('state', function () {
649
649
650
650
it ( 'inherit url parameters from current url' , inject ( function ( $state ) {
651
651
initStateTo ( $state . get ( 'root' ) , { param1 : 1 } ) ;
652
- expect ( $state . href ( "root" , { } , { } ) ) . toEqual ( "#/root" ) ;
652
+ expect ( $state . href ( "root" , { } , { } ) ) . toEqual ( "#/root?param1=1 " ) ;
653
653
expect ( $state . href ( "root" , { } , { inherit :false } ) ) . toEqual ( "#/root" ) ;
654
654
expect ( $state . href ( "root" , { } , { inherit :true } ) ) . toEqual ( "#/root?param1=1" ) ;
655
655
} ) ) ;
You can’t perform that action at this time.
0 commit comments