@@ -2826,7 +2826,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
2826
2826
* - **`lossy`** - {boolean=true} - If true, and if there is no url associated with the state provided in the
2827
2827
* first parameter, then the constructed href url will be built from the first navigable ancestor (aka
2828
2828
* ancestor with a valid url).
2829
- * - **`inherit`** - {boolean=false }, If `true` will inherit url parameters from current url.
2829
+ * - **`inherit`** - {boolean=true }, If `true` will inherit url parameters from current url.
2830
2830
* - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
2831
2831
* defines which state to be relative from.
2832
2832
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
@@ -2836,7 +2836,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
2836
2836
$state . href = function href ( stateOrName , params , options ) {
2837
2837
options = extend ( {
2838
2838
lossy : true ,
2839
- inherit : false ,
2839
+ inherit : true ,
2840
2840
absolute : false ,
2841
2841
relative : $state . $current
2842
2842
} , options || { } ) ;
@@ -3263,11 +3263,12 @@ function $ViewDirective( $state, $injector, $uiViewScroll) {
3263
3263
}
3264
3264
3265
3265
function updateView ( firstTime ) {
3266
- var newScope = scope . $new ( ) ,
3266
+ var newScope ,
3267
3267
name = getUiViewName ( attrs , $element . inheritedData ( '$uiView' ) ) ,
3268
3268
previousLocals = name && $state . $current && $state . $current . locals [ name ] ;
3269
3269
3270
3270
if ( ! firstTime && previousLocals === latestLocals ) return ; // nothing to do
3271
+ newScope = scope . $new ( ) ;
3271
3272
latestLocals = $state . $current . locals [ name ] ;
3272
3273
3273
3274
var clone = $transclude ( newScope , function ( clone ) {
@@ -3654,4 +3655,4 @@ function $IncludedByStateFilter($state) {
3654
3655
angular . module ( 'ui.router.state' )
3655
3656
. filter ( 'isState' , $IsStateFilter )
3656
3657
. filter ( 'includedByState' , $IncludedByStateFilter ) ;
3657
- } ) ( window , window . angular ) ;
3658
+ } ) ( window , window . angular ) ;
0 commit comments