Reputation: 548
What do you recommend to pass a message between routes? What I would like to get is:
I have thought on creating a new path for the login route (signup_confirmation). There, if the path is signup_confirmation, it will display the message.
Thoughts?
Thank you in advance!
Upvotes: 2
Views: 2314
Reputation: 27387
Base on your requirement, the service is a great place to share data between different app state.
An Ember.Service is an Ember object that lives for the duration of the application, and can be made available in different parts of your application.
Services are useful for features that require shared state or persistent connections. Example uses of services might include:
https://guides.emberjs.com/v2.11.0/applications/services/
Upvotes: 2
Reputation: 5991
Your options:
signupMessage
property to login
controller, then in signup
controller inject login
controller and set a value of signupMessage
after registration. Then you can display it in login
template (don't forgret to clear this property when user goes away from login
route, deactivate
event of route should help with this).memoryStorage
to store data that can be accessed from different places. In signup
controller you can then set a message and from login
controller get it and display (and remove from memoryStorage
, of course).Upvotes: 3