import { getAngularModule , getServices } from '../../opensearch_dashboards_services' ; import { getRootBreadcrumbs } from '../helpers/breadcrumbs' ; import html from './doc.html' ; import { Doc } from '../components/doc/doc' ; interface LazyScope extends ng . IScope { [ key ] : any ; } const { timefilter } = getServices ( ) ; const app = getAngularModule ( ) ; app . directive ( 'discoverDoc' , function ( reactDirective ) { return reactDirective ( Doc , [ [ 'id' , { watchDepth : 'value' } ] , [ 'index' , { watchDepth : 'value' } ] , [ 'indexPatternId' , { watchDepth : 'reference' } ] , [ 'indexPatternService' , { watchDepth : 'reference' } ] , ] , { restrict : 'E' } ) ; } ) ; app . config ( ( $routeProvider ) => { $routeProvider . when ( '/doc/:indexPattern/:index/:type' , { redirectTo : '/doc/:indexPattern/:index' , } ) . when ( '/doc/:indexPattern/:index' , { controller : function ( $scope , $route ) { timefilter . disableAutoRefreshSelector ( ) ; timefilter . disableTimeRangeSelector ( ) ; $scope . id = $route . current . params . id ; $scope . index = $route . current . params . index ; $scope . indexPatternId = $route . current . params . indexPattern ; $scope . indexPatternService = getServices ( ) . indexPatterns ; } , template : html , k7Breadcrumbs : ( $route ) => [ ... getRootBreadcrumbs ( ) , { text : `${ $route . current . params . index }#${ $route . current . params . id }` , } , ] , } ) ; } ) ;