title: AngularJS controller's variable is not updated
body: <p>I have problem with below code. I have <code>prices</code> factory which returns object containing prices received from server by websocket. Prices are sent after button <code>Create</code> is clicked. Problem is that <code>main.prices</code> variable is not updated at all. I can check everything by <code>Check</code> button, which confirms this. <code>Prices.data</code> is updated, but <code>this.prices</code> is not, but it refers the same object, so I thought it should be updated as well. Do you have any ideas why below does not work as expected?</p>
  
  <pre><code>angular.module('myApp', ['ngWebSocket'])
  
      .factory('ws', ['$websocket', function($websocket){
          var url = 'ws://localhost/websocket';
          var ws = $websocket(url);        
          return ws;
      }])
  
      .factory('prices', ['ws', function(ws){
          var prices = {
              data: [],
              clear: function(){
                  this.data = [];
              },
              create: function(){
                  ws.send('send')
              }
          }
  
          ws.onMessage(function(message){
              message = JSON.parse(message.data);
              var type = message.type;
  
              if (type == 'new prices'){               
                  prices.data = message.data;
              }
          });
  
          return prices;
      }])
  
      .controller('main', ['prices', function(prices){
          this.prices = prices.data;
  
          this.check = function(){
              console.log('works ', prices.data);
              console.log('not works ', this.prices);
          };
  
          this.create = function(){
              prices.create();
          };
  
          this.stop = function(){
              prices.clear();
          };
      }]);
  
  &lt;div ng-controller="main as main"&gt;
      {{ main.prices }}
      &lt;button ng-click="main.create()"&gt;Create&lt;/button&gt;
      &lt;button ng-click="main.stop()"&gt;Stop&lt;/button&gt;
      &lt;button ng-click="main.check()"&gt;Check&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>