javascript - Defining The Initial App in AngularJS - Argument 'fn' is not a function, got string - Stack Overflo

I'm using the more verbose syntax to define modules and the app. I have blank HTML page that pulls

I'm using the more verbose syntax to define modules and the app. I have blank HTML page that pulls in angular.js and then this file (app.js), and I get the error

Uncaught Error: Argument 'fn' is not a function, got string from testapp.

Do I have a typo, or misunderstand the parameters. Not sure what I am doing wrong.

file: app.js

    angular.module('testappmon', []);
    angular.module('testapp.controllers', []);
    angular.module('testapp.services', []);

    angular.module('testapp', ['testapp.controllers', 'testappmon', 'testapp.services'], function ($httpProvider) {

    });

I'm using the more verbose syntax to define modules and the app. I have blank HTML page that pulls in angular.js and then this file (app.js), and I get the error

Uncaught Error: Argument 'fn' is not a function, got string from testapp.

Do I have a typo, or misunderstand the parameters. Not sure what I am doing wrong.

file: app.js

    angular.module('testapp.mon', []);
    angular.module('testapp.controllers', []);
    angular.module('testapp.services', []);

    angular.module('testapp', ['testapp.controllers', 'testapp.mon', 'testapp.services'], function ($httpProvider) {

    });
Share Improve this question edited Feb 25, 2016 at 13:18 Glen Solsberry 12.3k16 gold badges73 silver badges96 bronze badges asked Aug 13, 2013 at 14:44 BuddyJoeBuddyJoe 71.2k115 gold badges301 silver badges473 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

This should some like this

    angular.module('testapp.mon', []);
    angular.module('testapp.controllers', []);
    angular.module('testapp.services', []);

    angular.module('testapp', ['testapp.controllers', 'testapp.mon', 'testapp.services'])
           .config(['$routeProvider', '$httpProvider', function ($routeProvider, $httpProvider) {
            }]);

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744885716a4599107.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信