DependencyInjection in JavaScript