js dependency injection a la angular