【发布时间】:2014-07-09 07:33:06
【问题描述】:
我在使用 UI Bootstrap 时遇到了一个非常奇怪的问题。即使是最简单的例子也行不通。所以这是我的情况:
我有一个使用 yeoman 插件的 Play Framework 应用程序:https://github.com/tuplejump/play-yeoman。它使用 AngularJS 和 Bootstrap。到目前为止一切正常,但是当我尝试使用来自http://angular-ui.github.io/ 的 UI Bootstrap 库打开我的第一个模式时,出现了这些奇怪的错误。我使用了来自http://angular-ui.github.io/bootstrap/#/modal 的确切代码,但不知何故它不起作用。这是打开我的模态的代码:
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
size: size,
resolve: {
items: function () {
return ['item1', 'item2', 'item3'];
}
}
});
并且在开发控制台中出现的错误是:
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 的方式:
<script src="components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
我一直在寻找解决方案很长时间,但我没有遇到 URL 中的函数 %20(a,b)%7... 的问题,并且没有一个解决方案有效。任何帮助表示赞赏!
【问题讨论】:
标签: angularjs playframework-2.0 angular-ui yeoman angular-ui-bootstrap