JavaScript Dependency Injection example (Angularjs style)