In my app I have a requirement for a functional area to open in an overlay such that it sits on top of the current route which could be almost any other route in the app.
This functional area will have it's own routes as it contains at least a master-detail view.
What is the current best practice for dealing with this situation?
Is it possible to have top-level routes that don't tear down the current route/views when entering them? If not and it's necessary to have the ApplicationController (or similar) handle the globally accessible overlay, what's the best way to achieve router-like functionality for that area?
At every level of nesting (including the top level), Ember automatically provides a route for the / path named index . To see when a new level of nesting occurs, check the router, whenever you see a function , that's a new level.
Here is the explanation: {{outlet}} -> This will provide a stub/hook/point into which you can render Components(Controller + View). One would use this with the render method of routes. In your case you will likely have a details route which could look like this.
In Ember Data, models are objects that represent the underlying data that your application presents to the user. Note that Ember Data models are a different concept than the model method on Routes, although they share the same name.
I think you got confused by open in overlay requirement and you are trying to solve non-existing problem.
Opening messaging functionality in another page in your app or opening it as overlay on top of the app is just a design thing that should be handled by CSS and existing app router. Just create messaging route, controller, etc.
You didn't say that, but in case you want to boot separate application there, the best approach is to open it in the iframe. New app, new lifecycle, etc. Again, how you display it inside another app is just matter of CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With