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

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!

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