【问题标题】:Module 'ui.bootstrap' is not available! any Module not working模块“ui.bootstrap”不可用!任何模块不工作
【发布时间】:2019-03-19 13:06:29
【问题描述】:

模块“ui.bootstrap”不可用!任何模块不工作。

有什么解决办法吗? 我正在使用角度 1.4.7

var App = angular.module('my-clinic', [
  'ngRoute', 'ngAnimate', 'ngStorage', 'ngCookies', 'ui.bootstrap', 
  'ngMessages', 'ui.router', 'ui.calendar'
]);

<script src="assets/vendor/ngstorage/ngStorage.js"></script>

我在所有 angular js 文件之后添加了这个文件

【问题讨论】:

  • 你能展示一下你是如何使用这个模块的吗?
  • var App = angular.module('my-clinic', ['ngRoute', 'ngAnimate', 'ngStorage', 'ngCookies', 'ui.bootstrap', 'ngMessages', 'ui .router', 'ui.calendar' ]);
  • 好的,这些模块在哪里加载?带有script 标签?
  • 我在所有 Angular js 文件之后添加了这个文件
  • ngRouteui.router 是两个不同的路由器;他们在一起玩得不好。

标签: angularjs angular-ui-bootstrap


【解决方案1】:

当您收到此错误时,请检查相关模块的名称是否正确以及定义此模块的文件是否已加载(通过&lt;script&gt; 标签、加载程序(如 require.js)或测试工具)像业力)。1

angular.module('ui.bootstrap.module', ['ui.bootstrap'])
.controller('ui.bootstrap.ctrl', function ($scope) {
  $scope.ToolTipText = "Hello, World!";
})
<link href="//unpkg.com/bootstrap@3/dist/css/bootstrap.css" rel="stylesheet">
<script src="//unpkg.com/angular/angular.js"></script>
<script src="//unpkg.com/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js"></script>

<div ng-app="ui.bootstrap.module" >
  <div ng-controller="ui.bootstrap.ctrl">

    <span uib-tooltip="{{ToolTipText}}" tooltip-placement="bottom" >
      Hover for Tooltip
    </span>

  </div>
</div>

【讨论】:

    猜你喜欢
    • 2014-08-13
    • 1970-01-01
    • 2014-01-18
    • 1970-01-01
    • 2018-11-20
    • 2018-06-07
    • 2016-11-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多