在AngularJS中定义初始应用程序 - 参数'fn'不是函数,得到字符串

Bud*_*Joe 0 javascript angularjs

我正在使用更详细的语法来定义模块和应用程序.我有空白的HTML页面拉入angular.js然后这个文件(app.js),我得到错误

未捕获错误:参数'fn'不是函数,从testapp获取字符串.

我有拼写错误,或误解参数.不确定我做错了什么.

file:app.js

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

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

    });
Run Code Online (Sandbox Code Playgroud)

Cha*_*ani 5

这应该是这样的

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

    angular.module('testapp', ['testapp.controllers', 'testapp.common', 'testapp.services'])
           .config(['$routeProvider', '$httpProvider', function ($routeProvider, $httpProvider) {
            }]);
Run Code Online (Sandbox Code Playgroud)