import './index.scss' ; import angular from 'angular' ; import { getServices } from '../opensearch_dashboards_services' ; /**
 * Here's where Discover's inner angular is mounted and rendered
 */ export async function renderApp ( moduleName , element ) { getServices ( ) . opensearchDashboardsLegacy . loadFontAwesome ( ) ; await import ( './angular' ) ; const $injector = mountDiscoverApp ( moduleName , element ) ; return ( ) => $injector . get ( '$rootScope' ) . $destroy ( ) ; } function mountDiscoverApp ( moduleName , element ) { const mountpoint = document . createElement ( 'div' ) ; const appWrapper = document . createElement ( 'div' ) ; appWrapper . setAttribute ( 'ng-view' , '' ) ; mountpoint . appendChild ( appWrapper ) ; const $injector = angular . bootstrap ( mountpoint , [ moduleName ] ) ; element . appendChild ( mountpoint ) ; return $injector ; }