【问题标题】:how can i define the injector to my app我如何为我的应用程序定义注入器
【发布时间】:2015-05-05 11:59:14
【问题描述】:

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

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

var myApp = angular.module('myApp', ['what injector:module is defined here']);

请帮帮我

【问题讨论】:

  • 我在 Angular js 中做无限滚动
  • 数据来自某些服务
  • 你能帮我解决这个请求吗?我如何使用 http 服务在 angular js 中进行无限滚动
  • 第一个谷歌点击是this
  • 尝试了不同的方法,但我没有得到答案

标签: javascript angularjs


【解决方案1】:

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

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

假设你需要 ui.bootstrap 依赖,你可以修改你的代码看起来像这样。

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

【讨论】:

  • 嗨,我使用了提到的外部 js 文件,那是如何在我的应用程序中定义的
  • 如何使用 http 服务在 Angular js 中进行无限滚动
猜你喜欢
  • 2021-12-11
  • 1970-01-01
  • 2023-03-31
  • 1970-01-01
  • 1970-01-01
  • 2019-08-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多