emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.47k stars 4.21k forks source link

Make boot URL available somehow #18513

Open mehulkar opened 5 years ago

mehulkar commented 5 years ago

For most apps, the initial URL of an app is /, but when using the visit() API, it may be useful to know this information later down the path (ignoring any redirects or other transitions that may happen by the app).

This bootURL could be available on the router or the router service, but because it can also be useful to see it in an initializer, and neither of those are fully setup during the boot process, some other mechanism may be required.

mehulkar commented 5 years ago

One approach would be to tack it onto options that are sent to EngineInstance#boot, and then making those options available to each instance initializers

Something similar could be done for initializers for Application#boot: