# Public keyword in controller

**URL:** <https://discuss.elastic.co/t/public-keyword-in-controller/167677>\
**Category:** Kibana\
**Created:** [February 8, 2019, 6:25pm UTC](https://discuss.elastic.co/t/public-keyword-in-controller/167677 "2019-02-08T18:25:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hegusung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hegusung/32/47826_2.png) [@hegusung](https://discuss.elastic.co/u/hegusung)\
**Post date:** [February 8, 2019, 6:25pm UTC](https://discuss.elastic.co/t/public-keyword-in-controller/167677/1 "2019-02-08T18:25:53Z")

</div>

Hello,

I am trying to develop a simple visualization plugin for Kibana 6.6 but I encounter an issue when coding the controller.

I would like to access the data like this inside my controller:

`$scope.esResponse.tables[0]`

but apparently, the data is not in a tabify form (I read it was supposed to be by default, but apparently not) so the 'table' key is undefined.

To do this I should execute:  
`const tabifyAggResponse = Private(AggResponseTabifyProvider);`

which requires the 'Private' keyword to be defined but for some reason I cannot add it like this like it is written in other modules found on the internet:  
`app.controller('CustomExportApp', function ($scope, Private) {`  
The error message is the following:  
TypeError: Expected private module "undefined" to be a function

for the moment this line is like this and it works (But I need to define the Private keyword somehow):  
`app.controller('CustomExportApp', function ($scope) {`

The full code can be found here:

> **[hegusung/custom\_export](https://github.com/hegusung/custom_export)**
>
> Kibana export button visualisation. Contribute to hegusung/custom\_export development by creating an account on GitHub.

What is wrong ?

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [February 18, 2019, 7:01pm UTC](https://discuss.elastic.co/t/public-keyword-in-controller/167677/2 "2019-02-18T19:01:02Z")

</div>

@mikecote another question on tabify.

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![mikecote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikecote/32/58549_2.png) [@mikecote](https://discuss.elastic.co/u/mikecote)\
**Post date:** [February 21, 2019, 3:27pm UTC](https://discuss.elastic.co/t/public-keyword-in-controller/167677/3 "2019-02-21T15:27:15Z")

</div>

@timroes do you have some insight as to what may be happening?

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [February 21, 2019, 4:30pm UTC](https://discuss.elastic.co/t/public-keyword-in-controller/167677/4 "2019-02-21T16:30:09Z")

</div>

Hi,

tabify has been stripped out of angular, so you would not need to pass that through `Private` anymore, but import the function from `ui/tabify/tabify` directly (you can check that file).

Nevertheless in 6.6 the incoming format should always be tabify, if you're using the default request handler (which you seem to use). You can also check this [blog post](https://www.elastic.co/blog/kibana-plugin-api-changes-in-6-5) for some information on the changes (that were mostly made in 6.5).

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 21, 2019, 4:30pm UTC](https://discuss.elastic.co/t/public-keyword-in-controller/167677/5 "2019-03-21T16:30:14Z")

</div>

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