在 Angular UI Boostrap 中打开模态时出现 404 Not Found 错误 [英] 404 Not Found error when opening modal in Angular UI Boostrap
问题描述
我在使用 UI Bootstrap 时遇到了一个非常奇怪的问题.即使是最简单的例子也行不通.所以这是我的情况:
I have a really strange problem when using UI Bootstrap. Even the simplest example does not work. So this is my case:
我有一个使用 yeoman 插件的 Play Framework 应用程序:https://github.com/tuplejump/play-约曼.它使用 AngularJS 和 Bootstrap.到目前为止一切正常,但是当我尝试使用来自 的 UI Bootstrap 库打开我的第一个模式时出现了这些奇怪的错误http://angular-ui.github.io/.我使用了 http://angular-ui.github.io/bootstrap/# 中的确切代码/modal 但不知何故它不起作用.这是打开我的模态的代码:
I have a Play Framework application using the yeoman plugin: https://github.com/tuplejump/play-yeoman. It is using AngularJS and Bootstrap. So far everything worked fine, but these weird errors came up when I tried to open my first modal using the UI Bootstrap library from http://angular-ui.github.io/. I used the exact code from http://angular-ui.github.io/bootstrap/#/modal but somehow it does not work. This is the code for opening my modal:
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
size: size,
resolve: {
items: function () {
return ['item1', 'item2', 'item3'];
}
}
});
而在开发控制台中出现的错误是:
And the errors that appear in the dev console are:
GET http://localhost:9000/ui/function%20(a,b)%7Breturn%20b.templateUrl%7C%7C%22template/modal/window.html%22%7D 404 (Not Found) angular.js:9499
Uncaught TypeError: undefined is not a function angular.js:9512
我尝试了许多类似问题的解决方案,但没有一个奏效.这是我加载 ui-boostrap 的方式:
I tried many solutions for similar problems but none of that worked. This is how I load the ui-boostrap:
<script src="components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
我一直在寻找解决方案很长时间,但我没有遇到 URL 中的函数 %20(a,b)%7... 的问题,并且没有一个解决方案有效.任何帮助表示赞赏!
I've been searching for solution for a long time but I haven't encountered a problem with the function%20(a,b)%7... in the URL and none of the soluions did work. Any help appreciated!
推荐答案
我遇到了同样的问题,似乎是版本冲突.我使用的是 Angular 1.0.8 版和 Angular Bootstrap 0.11.0.升级到 Angular 1.2.21 后,问题似乎已经解决了.
I had this same issue, and it appeared to be a version conflict. I was using Angular version 1.0.8 and Angular Bootstrap 0.11.0. After upgrading to Angular 1.2.21, the problem seems to have been resolved.
这篇关于在 Angular UI Boostrap 中打开模态时出现 404 Not Found 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!