UI-Router resolve entries are reloading twice when using $state.go or ui-sref when using an optional {parameter}, and the optional parameter is not filled.
.state('dashboard.loan', {
url: "/loan/:type/{instanceid}",
templateUrl: '/app/dashboard/views/package.html',
controller: 'PackageController',
controllerAs: 'packageCtrl',
resolve: {
UserAuth: session
}
})
// Resolves only once when both parameters are provided
$state.go( 'dashboard.loan',
{ packageType: packageType,
packageInstanceId: packageInstanceId } );
// Resolves twice when only one parameters is provided
$state.go( 'dashboard.loan',
{ packageType: packageType } );
I'm using ui-router v0.2.11. Any ideas, can't seem to find a solution.
Solution for v0.2.11 Don't use optional curly brace query parameter