Inject ngSanatize in Kibana app

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