You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AngularJS 1.4.7中ui.bootstrap模块不可用问题求解

Fixing "Module 'ui.bootstrap' is not available" in AngularJS 1.4.7

It looks like your app can’t find the ui.bootstrap module—this usually comes down to issues with script loading, version mismatches, or simple typos. Let’s walk through the most likely fixes step by step:

1. Make sure you’ve included the ui-bootstrap script file

You mentioned adding ngStorage.js, but you need to also include the angular-ui-bootstrap script in your HTML. This is the file that registers the ui.bootstrap module with Angular.

Add a script tag for it after your core AngularJS file, like this:

<!-- First load AngularJS core -->
<script src="assets/vendor/angular/angular.min.js"></script>
<!-- Then load ui-bootstrap -->
<script src="assets/vendor/angular-ui-bootstrap/ui-bootstrap.min.js"></script>
<!-- Then load other dependencies like ngStorage, ngRoute, etc. -->
<script src="assets/vendor/ngstorage/ngStorage.js"></script>
<!-- Finally load your app's module script -->
<script src="path/to/your/app-module.js"></script>

Pro tip: Open your browser’s developer tools (F12) and check the Network tab. If the ui-bootstrap file shows a 404 error, your file path is incorrect—adjust the src attribute to match where you’ve placed the file.

2. Verify version compatibility

AngularJS 1.4.7 works best with angular-ui-bootstrap versions 0.13.x to 2.5.x (all built specifically for AngularJS 1.x). If you’re using a version outside this range (like one meant for Angular 2+), you’ll run into compatibility issues. Stick to releases explicitly labeled for AngularJS 1.x.

3. Confirm script load order is correct

Angular needs to know about a module before your app tries to depend on it. The correct load order must be:

  • AngularJS core first
  • All dependent modules (ui-bootstrap, ngStorage, ngRoute, etc.) next
  • Your app’s module definition last

If your app’s script loads before ui-bootstrap, Angular will throw the "module not available" error because ui.bootstrap hasn’t been registered yet.

4. Double-check for typos

Even small mistakes can break things. Make sure:

  • The dependency in your module definition is exactly 'ui.bootstrap' (lowercase, with a dot, no extra characters)
  • The script file you’re loading is indeed the one that registers the ui.bootstrap module (older rare versions might use a different name, but this is unlikely for recent 1.x-compatible releases)

5. Rule out conflicts

  • Ensure you’re not loading multiple versions of AngularJS (this can cause module registration to fail)
  • Check if any other script accidentally redefines the ui.bootstrap module (e.g., a script that does angular.module('ui.bootstrap', []) without the correct internal dependencies)

Following these steps should resolve the module not found error.

内容的提问来源于stack exchange,提问作者Vijay Prajapati

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 06:31:01