Unknown Provider upon call to Private (kibana app plugin)

This is my third question in 3 days. Im not an angular programmer and im struggling through this, feel free to disregard if ts a stupid question.

this is my app.js:

import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
import t from './templates/index.html';

uiRoutes.enable();
uiRoutes
.when('/', {
  template: t,
  controller: 'aController'
});

uiModules
.get('app/myapp', [])
.controller('aController', function(Private) {
const fBQF = Private(FilterBarQueryFilterProvider); // THIS LINE Errors!
//this.globalFilters = fBQF.getGlobalFilters();
});

I am using the undocumented portions of the api, namely ui/filter_bar/query_filter, so I get that things may be a bit broken. I am getting an Unknown Provider error:

Error: [$injector:unpr] Unknown provider: courierProvider <- courier
...

full stack trace available at https://pastebin.com/AYscSeRH

Why does this happen?

Hi,

There are no stupid questions. I am going to ask our dev team to take a look at it.

Cheers,
Bhavya

any update?

@Bargs/@lukas can one of you take a look at this question please?

Thanks,
Bhavya

You might need to autoload kibana's angular services: https://www.elastic.co/guide/en/kibana/6.2/development-modules.html#_autoloading

Also I think you might need to add the kibana module as a dependency so:

uiModules
.get('app/myapp', ['kibana'])
.controller('aController', function(Private) {
const fBQF = Private(FilterBarQueryFilterProvider); // THIS LINE Errors!
//this.globalFilters = fBQF.getGlobalFilters();
});

(note that I added kibana to the array argument on the second line)

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