Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose plugin injected variables to angular config #8277

Closed
jmcarp opened this issue Sep 14, 2016 · 4 comments
Closed

Expose plugin injected variables to angular config #8277

jmcarp opened this issue Sep 14, 2016 · 4 comments

Comments

@jmcarp
Copy link

jmcarp commented Sep 14, 2016

AFAICT, injected variables in plugins are exposed to the frontend via angular services, which can't be injected into a config() block. In the case where a plugin wants to pass injected variables to config(), it seems like the developer has to use chrome.getInjected or pull values from __KBN__. Would it be possible to implement injected variables as constants instead of services, so that they can be injected into config()?

@epixa
Copy link
Contributor

epixa commented Sep 14, 2016

Thanks for the feature request!

While I'm sure this is possible, we're not really interested in further coupling ourselves or plugins to angular. We'd probably consider a solid PR from the community for this, but I don't expect this to happen otherwise.

@jmcarp
Copy link
Author

jmcarp commented Sep 15, 2016

Are you all planning to move away from angular or otherwise decouple plugins from angular--for example, do you prefer using chrome.getInjected over angular dependency injection? If so, then this refactor probably wouldn't be worthwhile. WDYT?

@epixa
Copy link
Contributor

epixa commented Sep 15, 2016

For practical reasons, it's safe to say that angular will be a part of Kibana for a long time, but it's definitely our intention to make it less and less integral over time. If you're building a plugin that relies on angular, you're not going to suddenly be left in the dark because most of our plugins also use angular. In the end, it's hard to say right now which mechanism will be the best if/when we make more fundamental changes to how plugins integrate with Kibana.

@epixa
Copy link
Contributor

epixa commented Apr 25, 2017

I'm going to close this as we have officially decided to move away from angular over the long term. In the future, plugins will get data like this from the new platform itself, and we won't be tying directly into angular at all. Plugins will still be able to use angular, of course, but they'll be responsible for wiring their angular apps up.

@epixa epixa closed this as completed Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants