gwhn gwhn - 1 year ago 95
AngularJS Question

How to send and retrieve parameters using $state.go toParams and $stateParams?

I am using AngularJS v1.2.0-rc.2 with ui-router v0.2.0. I want to pass the referrer state to another state so I use the

like so:

$state.go('toState', {referer: $});

According to the docs, this should populate the
on the
controller, but it is
. What am I missing?

I've created a plunk to demonstrate:

Answer Source

All I had to do was add a parameter to the url state definition like so

url: '/toState?referer'


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download