Hello I try to make a hello world plugin inside kibana so I use the yeoman generator but there is the following error:
[ng:areq] Argument 'pluginTestHelloWorld' is not a function, got undefined
I show my index.js
import exampleRoute from './server/routes/example';
export default function (kibana) {
return new kibana.Plugin({
require: ['kibana', 'elasticsearch'],
uiExports: {
app: {
title: 'CloudUnit',
description: 'A CloudUnit plugin',
main: 'plugins/cloudunit_kibana/app',injectVars: function (server, options) { var config = server.config(); return { kbnIndex: config.get('kibana.index'), esShardTimeout: config.get('elasticsearch.shardTimeout'), esApiVersion: config.get('elasticsearch.apiVersion') }; } }, visTypes: [ 'plugins/cloudunit_kibana/vis_type' ], },
config(Joi) { return Joi.object({ enabled: Joi.boolean().default(true), }).default(); },
init(server, options) { // Add server routes and initalize the plugin here exampleRoute(server); }
});
};
And this is my app.js which contains my "pluginTestHelloWorld" controller
import moment from 'moment';
import chrome from 'ui/chrome';
import uiModules from 'ui/modules';
import uiRoutes from 'ui/routes';
import 'ui/autoload/styles';
//import './less/main.less';
import template from './templates/index.html';
uiRoutes.enable();
uiRoutes
.when('/', {
template,
resolve: {
currentTime($http) {
return $http.get('../api/cloudunit_kibana/example').then(function (resp) {
console.log(resp.data.time);
return resp.data.time;
});
}
},
controller: 'pluginTestHelloWorld'
});
uiModules
.get('app/cloudunit_kibana', )
.controller('pluginTestHelloWorld', function ($scope) {
$scope.title = 'Plugin Test';
$scope.description = 'An awesome Kibana plugin';
var currentTime = moment($route.current.locals.currentTime);
$scope.currentTime = currentTime.format('HH:mm:ss');
var unsubscribe = $interval(function () {
$scope.currentTime = currentTime.add(1, 'second').format('HH:mm:ss');
}, 1000);
$scope.$watch('$destroy', unsubscribe);
});
Do you know why the ng-controller syntaxe in template make this issue?