import { TransitionService } from '@uirouter/core/lib/transition/transitionService' ; export interface CustomRootScope extends ng . IRootScopeService { changingState : boolean ; } export function run ( $transitions , $rootScope ) { "ngInject" ; $transitions . onStart ( { } , function ( trans ) { $rootScope . changingState = true ; trans . promise . finally ( ( ) => $rootScope . changingState = false ) ; } ) ; }