Jeroen Nouws | 30 Sep 15:44 2013

argument 'fn' is not a function got string

I have a part in my angular application on which I've binded a controller,
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?

I would be very gratefull :)


<section class="col-lg-12" data-ng-controller="MessageController"> <fieldset> <legend>{{ 'MESSAGES' | translate }}</legend> </fieldset> <div class="margin-left-15"> <ul class="list-style-button"> <li data-ng-repeat="message in MSG">{{ message }}</li> </ul> </div> </section>


(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; }); }]); }());


(function(){ 'use strict'; var messageServices = angular.module(''); 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 && messages !== undefined){ return JSON.parse(messages); } else { return this.messageData.query({locale: locale}, $.proxy(function(data, locale){, JSON.stringify(data)); }, this)); } }; = function(key, value){ this.localStorageService.add(key, value); }; }());


(function(){ 'use strict'; var data = angular.module(''); data.factory('MessageData', function($resource){ return $resource(Constants.url_messages,{},{ query: {method: 'GET', params: {locale: 'locale'}, isArray: true} }); }); }());

order of js files in html head:

<script src="js/lib/jquery-1.10.js"></script> <script src="js/lib/angular.js"></script> <script src="js/lib/angular-resource.js"></script> <script src="js/lib/angular-translate.js"></script> <script src="js/lib/angular-localstorage.js"></script> <script src="js/lib/jquery-cookies.js"></script> <script src="js/lib/bootstrap.js"></script> <script src="js/portal.js"></script>

You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe <at>
To post to this group, send email to angular <at>
Visit this group at
For more options, visit