let id = 0 ; const prefix = 'ng2Multi' ; const map = { } ; function bootstrapMulti ( fn , ngModule , name , target ) { map [ name ] = map [ name ] || [ ] ; let privateName = `${ prefix }_${ fn }_${ name }_${ ++ id }` ; ngModule [ fn ] ( privateName , target ) ; map [ name ] . push ( privateName ) ; ngModule . factory ( name , [ ... map [ name ] , ( ... args ) => args ] ) ; } export function bootstrapMultiFactory ( ngModule , name , target ) { bootstrapMulti ( 'factory' , ngModule , name , target ) ; } export function bootstrapMultiInjectable ( ngModule , name , target ) { bootstrapMulti ( 'service' , ngModule , name , target ) ; } export function bootstrapMultiValue ( ngModule , name , target ) { bootstrapMulti ( 'value' , ngModule , name , target ) ; }