Skip to content

Commit

Permalink
Fix angular compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed May 4, 2020
1 parent da40cf0 commit bbd9aca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/plugins/discover/public/application/angular/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ app.config(($routeProvider: any) => {
})
// the new route, es 7 deprecated types, es 8 removed them
.when('/discover/doc/:indexPattern/:index', {
controller: ($scope: LazyScope, $route: any, es: any) => {
// have to be written as function expression, because it's not compiled in dev mode
// eslint-disable-next-line object-shorthand
controller: function($scope: LazyScope, $route: any, es: any) {
timefilter.disableAutoRefreshSelector();
timefilter.disableTimeRangeSelector();
$scope.esClient = es;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/discover/public/get_inner_angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ function createElasticSearchModule(data: DataPublicPluginStart) {
angular
.module('discoverEs', [])
// Elasticsearch client used for requesting data. Connects to the /elasticsearch proxy
.service('es', () => {
// have to be written as function expression, because it's not compiled in dev mode
.service('es', function() {
return data.search.__LEGACY.esClient;
});
}
Expand Down

0 comments on commit bbd9aca

Please sign in to comment.