I want to add the id i get from
$state.go('state1', {obj: {id: request.id, title: request.title}}
to the URL in
angular.module('app')
.config(function ($stateProvider) {
$stateProvider
.state('state1', {
url : '/edit',
params: {obj: null},
...
});
});
I accessed the id in my Controller using
vm.id = $stateParams.obj.id;
and tried adding it to the url by trying
url : '/edit/:id'
url : '/edit/:obj.id'
I tried searching for a while but it's either they are passing params (not object) or they are passing an object but uses a static url. I'm new to Angular can someone point out what i'm missing? Thanks.