Assume that we define state like this:
(function() {
'use strict';
angular.module('app').config(stateConfig);
function stateConfig($stateProvider) {
$stateProvider
.state('baseInformation', {
parent: 'panel',
params: {
param1: null
},
data: {
data1: 'sample data'
},
url: 'baseInformation',
views: {
'panel': {
templateUrl: 'app/baseInformation.html',
controller: 'BaseInformationController',
controllerAs: 'vm'
}
}
});
}
})();
I want to change the value of data when using $state.go, please note i don't want to use from params. maybe something like this:
$state.go('baseInformation', {data1: 'data1 changed'});
Is there a way to do this, with $state.go or other thing?
$transition$.params().param1 = -1;datato set static information for a state (title, whether certain elements should be shown, etc.) because it's a nice place to consolidate all of that.paramsare meant to pass initial dynamic data to a state. I don't see that either of those require modification outside of the state transition so perhaps you are approaching whatever problem you're trying to solve from the wrong direction.