# Get access to $scope and indexPatterns in a hack plugin in Kibana 6.8

**URL:** <https://discuss.elastic.co/t/get-access-to-scope-and-indexpatterns-in-a-hack-plugin-in-kibana-6-8/187433>\
**Category:** Kibana\
**Created:** [June 25, 2019, 9:25pm UTC](https://discuss.elastic.co/t/get-access-to-scope-and-indexpatterns-in-a-hack-plugin-in-kibana-6-8/187433 "2019-06-25T21:25:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![srbdev](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@srbdev](https://discuss.elastic.co/u/srbdev)\
**Post date:** [June 25, 2019, 9:25pm UTC](https://discuss.elastic.co/t/get-access-to-scope-and-indexpatterns-in-a-hack-plugin-in-kibana-6-8/187433/1 "2019-06-25T21:25:15Z")

</div>

I have the following piece of code:

```
uiModules
   .get('kibana')
   .run((Private, getAppState, $scope) => {
       console.log($scope);
       // get indexPatterns here...
   }

```

It gives the following error: `[$injector:unpr] Unknown provider: $scopeProvider`.

How do I get access to the index patterns? Note that the hack plugin runs on a dashboard.

Thanks!

---

<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:** [July 23, 2019, 9:25pm UTC](https://discuss.elastic.co/t/get-access-to-scope-and-indexpatterns-in-a-hack-plugin-in-kibana-6-8/187433/2 "2019-07-23T21:25:21Z")

</div>

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