How Can I pass and object throw views?


#1

How Can I pass and object throw views and route params at the same time? My controller have url params but when I do this
$state.go(‘url/param’,{key:’'value})

I just get the param on the controller when I debug the stateParams.

Thanks in advanced,


#2

Why not use a storage solution like localStorage or localForage? Both are quick and painless…


#3

If the keys in your object are not defined on the state, they will NOT pass to the controller in $stateParams.

So, if your state URL is : /home/, you will not get any state params.

If you need “memberId” in the state params, you need to do this : /home/{memberId} or /home/:memberId.

If you need to pass any other information, then you’ll need to store it in a service in this first controller, then collect it from the service in the second controller.