I perfectly initialized $ stateProvider and I use all of these states with ui-sref. It works great. The user clicks the button and transfers $ stateProvider to the edit page.
On this page, I have a form that asks for $ http:
this.pushData = function (data) {
$http.post('/data/' + $stateParams.dataId + '/otherdata', JSON.stringify({
id: otherdata.id,
name: otherdata.name
}), configAuth).then(
function success(response) {
var addedData = response.data;
$.notify({message: addedData.name + " has been added"},{type:'success'});
$state.go('roleInfo({roleId: $stateParams.roleId})');
},
function error(data) {
console.log(data);
$.notify({message: data.data.message},{type:'danger'});
}
);
}
And I want to redirect to another view, if everything is in order. But this:
$ state.go ('roleInfo ({roleId: $ stateParams.roleId})');
does not work. How can I make $ state.go with parameters?
source
share