File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 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) {
10911091 * - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the
10921092 * first parameter, then the constructed href url will be built from the first navigable ancestor (aka
10931093 * 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.
10951095 * - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
10961096 * defines which state to be relative from.
10971097 * - **`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) {
11011101 $state . href = function href ( stateOrName , params , options ) {
11021102 options = extend ( {
11031103 lossy : true ,
1104- inherit : false ,
1104+ inherit : true ,
11051105 absolute : false ,
11061106 relative : $state . $current
11071107 } , options || { } ) ;
Original file line number Diff line number Diff line change @@ -649,7 +649,7 @@ describe('state', function () {
649649
650650 it ( 'inherit url parameters from current url' , inject ( function ( $state ) {
651651 initStateTo ( $state . get ( 'root' ) , { param1 : 1 } ) ;
652- expect ( $state . href ( "root" , { } , { } ) ) . toEqual ( "#/root" ) ;
652+ expect ( $state . href ( "root" , { } , { } ) ) . toEqual ( "#/root?param1=1 " ) ;
653653 expect ( $state . href ( "root" , { } , { inherit :false } ) ) . toEqual ( "#/root" ) ;
654654 expect ( $state . href ( "root" , { } , { inherit :true } ) ) . toEqual ( "#/root?param1=1" ) ;
655655 } ) ) ;
You can’t perform that action at this time.
0 commit comments