import { IScope } from 'angular' ; import { RenderCompleteListener } from '../../../../../opensearch_dashboards_utils/public' ; export function createRenderCompleteDirective ( ) { return { controller ( $scope , $element ) { const el = $element [ 0 ] ; const renderCompleteListener = new RenderCompleteListener ( el ) ; $scope . $on ( '$destroy' , renderCompleteListener . destroy ) ; } , } ; }