Rectangle 27 0

How to pass object with ui router betwenn controllers in a $state angularjs?


service

I have read that answer but using a controller can be a bit messy. If i need to use this data in more views i have to add a function or a nee service every time. If i can't pass objects, can i pass some attributes of the objects?

It's my understanding that you can't pass objects between states as params. One option is to use a service which is accessible by all controllers that you inject it into.

Note