Inject ngSanatize in Kibana app

Hi to all the happy programmers out there,

i'm writing a plugin app for Kibana and all is functioning suberb!

But now i want to inject ngSanatize into the app but where to configure that...
Any help is very welcome!

Tnx in advance

Martijn

First, run npm install angular-sanitize to install the node package into your project and update the package.json.

Then you would inject 'ngSanitize' into your module. The place to inject dependencies is where uiModules.get() is called. If you are using the plugin generator, then that would be here: https://github.com/elastic/generator-kibana-plugin/blob/master/src/generators/app/templates/public/app.js#L28

The app.js in your project would look like:

// top of the file
import 'angular-sanitize';

// further down
uiModules
.get('app/myplugin', ['ngSanitize'])
.controller(...)

Note that I haven't tested this, but that should help get you started.

1 Like

Thank you very much for your fast reaction Tim!

It looks like i need to setup a nice Linux machine 'cause yeoman on Windows is such a pain in the butt.

Martijn