import { isNullOrUndefined } from '@syncfusion/ej2-base' ; hidden export class ServiceLocator { private services : { [ x ] : Object ; } = { } ; public register < T > ( name , type ) { if ( isNullOrUndefined ( this . services [ name ] ) ) { this . services [ name ] = type ; } } public getService < T > ( name ) { if ( isNullOrUndefined ( this . services [ name ] ) ) { throw `The service ${ name } is not registered` ; } return < T > this . services [ name ] ; } }