Inject angular controller in Init of a kibana plugin


(Saurav kumar) #1

Hello There,

I am new with Kibana plugin development. I have created a plugin but i would like to call a angular controller in init function.

For example :

init(server, options) {

}

I found this in Tim roes plugin development and i found that using this i can use elastic search query.But instead of using any server relation i would like to call a angular controller that i have created in my app.js or if required i can create other page as well.

Let me know if i missed anything to explain.

@lukas @LeeDr your early response will be appreciated.


(Jim Unger) #2

The init function is for initializing your server-side code.

If you want to load client side code, you need to specify it in the uiExports section.

import { resolve } from 'path';

export default (kibana) => new kibana.Plugin({
  id: 'myplugin',
  publicDir: resolve(__dirname, 'public'),
  require: ['kibana', 'elasticsearch'],
  uiExports: {
    managementSections: [
      'plugins/myplugin/mydirective'
    ]
  },
  init: (server) => {}
});


(Saurav kumar) #3

@BigFunger

Thank you for your response.

Basically my requirement is like, I would like to change kibana Logo or document title.Which i am able to do when i route any url under my plugin.But i would like to get it effective when Kibana load.So i would like to call angular controller when Kibana Get load.

Let me know if it make sense to you.

Regard


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.