title: Mock method of an instance variable of an angular service in jasmine
body: <p>In essence I want to create a spy object of something of the like:</p>
  
  <p>myService.myVariable.get()</p>
  
  <p>However, I can't seem to mock it properly. If i try </p>
  
  <pre><code> myServiceMock = jasmine.createSpyObj("myService", ["myVariable"]);
  </code></pre>
  
  <p>Then I get that .get() is undefined for it. Similarly </p>
  
  <pre><code> myServiceMock = jasmine.createSpyObj("myService", ["myVariable.get"]);
  </code></pre>
  
  <p>Then I get that myVariable is undefined in the test. In case it is relevant, the code to inject our mock service:</p>
  
  <pre><code>vm = $componentController('home', {$uibModal: modal, myService: myService});
  </code></pre>
  
  <p>I'm not looking at all to test the service, I just want to be able to intercept that call. In the component being tested, the line calling this is</p>
  
  <pre><code>myService.myService.get({.....});
  </code></pre>