old_contents: 'use strict';
  
  /**
   * @ngdoc service
   * @name meanDemoApp.questionService
   * @description
   * # questionService
   * Factory in the meanDemoApp.
   */
  angular.module('meanDemoApp')
    .factory('Question', function ($resource, $rootScope) {
  
      var rootUrl = 'http://192.168.1.113:4567';
      var apiRootUrl = rootUrl + '/api';
  
      broadcastEvents();
  
      return $resource(
        apiRootUrl + '/questions/:id',
        { id: '@id' },
        { vote: {
          method: 'POST',
          url: apiRootUrl + '/questions/:id/vote' }
        }
      );
  
      //////////////
      function broadcastEvents(){
          var socket = window.io.connect(rootUrl);
  
          socket.on('questionAdded', function (question) {
            $rootScope.$broadcast('questionAdded', question);
          });
  
          socket.on('questionDeleted', function (questionId) {
            $rootScope.$broadcast('questionDeleted', questionId);
          });
  
          socket.on('voteAdded', function (voteMsg) {
            $rootScope.$broadcast('voteAdded', voteMsg);
          });
  
      }
    });
  
new_contents: 'use strict';
  
  /**
   * @ngdoc service
   * @name meanDemoApp.questionService
   * @description
   * # questionService
   * Factory in the meanDemoApp.
   */
  angular.module('meanDemoApp')
    .factory('Question', function ($resource, $rootScope) {
  
      var rootUrl = 'http://localhost:4567';
      var apiRootUrl = rootUrl + '/api';
  
      broadcastEvents();
  
      return $resource(
        apiRootUrl + '/questions/:id',
        { id: '@id' },
        { vote: {
          method: 'POST',
          url: apiRootUrl + '/questions/:id/vote' }
        }
      );
  
      function broadcastEvents(){
          var socket = window.io.connect(rootUrl);
  
          socket.on('questionAdded', function (question) {
            $rootScope.$broadcast('questionAdded', question);
          });
  
          socket.on('questionDeleted', function (questionId) {
            $rootScope.$broadcast('questionDeleted', questionId);
          });
  
          socket.on('voteAdded', function (voteMsg) {
            $rootScope.$broadcast('voteAdded', voteMsg);
          });
      }
    });
  
subject: Revert accidentally hardcoding IP