title: Inject $rootScope into factory works only partially
body: <p>In this plunker the factory gets a $rootScope injected.</p>
  
  <p>The plunker is not from me.</p>
  
  <p>When I inject the $rootScope into my own factories it does not work.</p>
  
  <p>Why does it work in the plunker? Where is it written that I can inject the $rootScope in a factory? </p>
  
  <p><a href="http://plnkr.co/edit/2hoMTaloeqbgSe81VQLF?p=preview" rel="nofollow">http://plnkr.co/edit/2hoMTaloeqbgSe81VQLF?p=preview</a></p>
  
  <pre><code>var app = angular.module('plunker', []);
  
  app.factory('messageService', function($rootScope) {
  
  
  alert($rootScope);
    var messenger = {
      messages: [],
      identity: 0,
      addMessage: function(text, caller) {
  
        this.identity +=1;
        var id = this.identity,
         message = {
          text: caller + text,
          id: id
        };
  
        this.messages.push(message);
        $rootScope.$broadcast('messageAdded');
      }
    };
  
    return messenger;
  });
  
  app.controller('Controller1', function($scope, messageService) {
    $scope.messages1 = messageService.messages;
    $scope.post = {
      text: ''
    };
  
    $scope.postMessage = function() {
      console.log($scope.post);
      messageService.addMessage($scope.text, "controller 1");
    };
  
    $scope.$on('messageAdded', function() {
      $scope.messages1 = messageService.messages;
    });
  });
  
  
  
  app.controller('Controller2', function($scope, messageService) {
    $scope.messages2 = messageService.messages;
    $scope.post = {
      text: ''
    };
  
    $scope.postMessage = function() {
      messageService.addMessage($scope.text, "controller 2");
    };
  
    $scope.$on('messageAdded', function() {
      $scope.messages2 = messageService.messages;
    });
  });
  </code></pre>
  
  <p>THIS is just a sample code of myself and I have no idea why the $rootScope is not injected:</p>
  
  <pre><code>'use strict';
  angular.module('test').factory('MyViewModel', function ($rootScope) {
  
      function MyViewModel(items ) {
  
          var self = this;
          self.items = items ;
  
       }
  
  
      return( MyViewModel);
  });
  </code></pre>