title: Argument 'fn' is not a function got string
body: <p>I have a part in my angular application on which I've binded a controller,<br/>
  since then I got the Argument 'fn' is not a function Error, can anyone look at my code and explain why I got that Error?</p>
  
  <p>I would be very gratefull :)</p>
  
  <p>html-markup:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;section class="col-lg-12" data-ng-controller="MessageController"&gt;
    &lt;fieldset&gt;
      &lt;legend&gt;{{ 'MESSAGES' | translate }}&lt;/legend&gt;
    &lt;/fieldset&gt;
    &lt;div class="margin-left-15"&gt;
      &lt;ul class="list-style-button"&gt;
        &lt;li data-ng-repeat="message in MSG"&gt;{{ message }}&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>controller:</p>
  
  <pre class="lang-js prettyprint-override"><code>(function() {
    'use strict';
  
    var controllers = angular.module('portal.controllers');
  
    controllers.controller('MessageController', ['$scope', 'MessageService', '$rootScope', function MessageController($scope, MessageService, $rootScope) {
      $rootScope.MSG = MessageService.getMessages();
  
      $rootScope.$watch('MSG', function(newValue) {
        $scope.MSG = newValue;
      });
    }]);
  }());
  </code></pre>
  
  <p>Service:</p>
  
  <pre class="lang-js prettyprint-override"><code>(function() {
  
    'use strict';
  
    var messageServices = angular.module('portal.services');
  
    messageServices.factory('MessageService', ['MessageData', 'localStorageService', 'UserService'], function(MessageData, localStorageService, UserService) {
      return new MessageService(MessageData, localStorageService, UserService);
    });
  
    function MessageService(MessageData, localStorageService, UserService) {
      this.messageData = MessageData;
      this.localStorageService = localStorageService;
      this.userService = UserService;
    }
  
    MessageService.prototype.getMessages = function() {
      var locale = this.userService.getUserinfoLocale();
      var messages = this.localStorageService.get(Constants.key_messages + locale);
      if (messages !== null &amp;&amp; messages !== undefined) {
        return JSON.parse(messages);
      } else {
        return this.messageData.query({
          locale: locale
        }, $.proxy(function(data, locale) {
          this.save(Constants.key_messages + locale, JSON.stringify(data));
        }, this));
      }
    };
  
    MessageService.prototype.save = function(key, value) {
      this.localStorageService.add(key, value);
    };
  
  }());
  </code></pre>
  
  <p>data:</p>
  
  <pre class="lang-js prettyprint-override"><code>(function() {
    'use strict';
  
    var data = angular.module('portal.data');
  
    data.factory('MessageData', function($resource) {
      return $resource(Constants.url_messages, {}, {
        query: {
          method: 'GET',
          params: {
            locale: 'locale'
          },
          isArray: true
        }
      });
    });
  }());
  </code></pre>
  
  <p>order of js files in html head:</p>
  
  <pre><code>&lt;script src="js/lib/jquery-1.10.js"&gt;&lt;/script&gt;
  &lt;script src="js/lib/angular.js"&gt;&lt;/script&gt;
  &lt;script src="js/lib/angular-resource.js"&gt;&lt;/script&gt;
  &lt;script src="js/lib/angular-translate.js"&gt;&lt;/script&gt;
  &lt;script src="js/lib/angular-localstorage.js"&gt;&lt;/script&gt;
  &lt;script src="js/lib/jquery-cookies.js"&gt;&lt;/script&gt;
  &lt;script src="js/lib/bootstrap.js"&gt;&lt;/script&gt;
  &lt;script src="js/portal.js"&gt;&lt;/script&gt;
  </code></pre>