如何为我的应用程序定义注射器

时间:2015-05-05 11:59:14

标签: javascript angularjs

https://code.angularjs.org/1.0.0rc9/angular-1.0.0rc9.js

以上链接定义了外部js文件我不知道注入到angular-1.0.0rc9.js所以我的应用程序没有在浏览器中运行

var myApp = angular.module('myApp',['什么注入器:模块在这里定义']);

请帮帮我

1 个答案:

答案 0 :(得分:1)

您不需要注入任何依赖项来启动您的应用。但是,您应该在需要时添加依赖项。

(function () {
    'use strict';
     var myApp = angular.module('myApp');
})();

假设您需要ui.bootstrap依赖项,您可以将代码修改为这样。

(function () {
        'use strict';
         var myApp = angular.module('myApp', ['ui.bootstrap']);
 })();