angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

$transition$.params() not update with default param value #3714

Closed HASSANDL closed 4 years ago

HASSANDL commented 6 years ago

Hello, I have a route with below config.

{
    name: 'app.reports.view',
    config: {
        url: '/view/{id:int}',
        params: {
            id: {
                value: null,
                squash: true,
            },
            clearCache: false,
        },
        resolve: {
            reportData: function ($transition$) {
                console.log($transition$.params().clearCache);
                return {};
            }
        }
    }
}

after run below code:

$state.go('app.reports.view', {id: 1, clearCache: true})

clearCache always true even use below code:

$state.go('app.reports.view', {id: 2})
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.