import { Injectable } from '@angular/core' ; import { ListComponent } from '../list.component' ; import { LoadOnDemandEventData } from '../list.event' ; @ Injectable ( ) export class ListHelper { onLoadOnDemand ( component , _event ) { if ( component . isLoadOnDemandEnabled && ! component . _isLoading ) { component . _isLoading = true ; component . loadOnDemand . emit ( { complete : ( disableLoadOnDemand ) => { component . isLoadOnDemandEnabled = ! disableLoadOnDemand ; component . _isLoading = false ; } , } ) ; } } }