title: Interfaces for injectable services in AngularJS
body: <p>I'm new to AngularJS. From what I understand, the whole point of dependency injection is so that the dependency can be easily swapped with a "similar" dependency later and the code still works the same. With "similar", it is usually meant that the dependency implements some kind of an interface. </p>
  
  <p>If I'm writing a controller and my co-worker is writing a service which I'm going to use in my controller, how can I make sure that the service he is making for me has all the things I need? In a traditional OO language, his service would be a class implementing an interface, which would force him to implement certain methods. But how can this be done in angularJS? Would I have to check if the service has properties for all the methods I want and that the <code>__proto__</code> for all those properties is <code>Function.prototype</code>? And to check the what these methods return, do I have call them with mock objects and then inspect the returned object?
  Or is there a better recommended way of doing this?</p>