Java UI引导(AngularJS)模式不工作

Java UI引导(AngularJS)模式不工作,java,javascript,angularjs,angular-ui-bootstrap,Java,Javascript,Angularjs,Angular Ui Bootstrap,我有这个实践项目,我正在工作,但我不能让我的UI Boostratp模式工作。使用该站点的示例,我一直在尝试实现此功能,但没有成功 我相信这是因为我不知道如何将演示代码集成到我的MVC风格的项目中(我有单独的app.js、controller和service文件),而这一个文件示例让我相当困惑 我的文件夹/文件结构: 现在,我已经尝试了各种方法,包括制作一个单独的控制器和模式内容的单独视图(这就是为什么我有bookDetailes.html和bookDetailesConreoller.js文

我有这个实践项目,我正在工作,但我不能让我的UI Boostratp模式工作。使用该站点的示例,我一直在尝试实现此功能,但没有成功

我相信这是因为我不知道如何将演示代码集成到我的MVC风格的项目中(我有单独的app.js、controller和service文件),而这一个文件示例让我相当困惑

我的文件夹/文件结构:

现在,我已经尝试了各种方法,包括制作一个单独的控制器和模式内容的单独视图(这就是为什么我有bookDetailes.html和bookDetailesConreoller.js文件,但它们目前没有顺序-在app.js的stat provider中没有连接,它们的代码正在注释中)。这就是我的处境:

A具有从数据库检索的基本书籍详细信息列表,并通过data ng repeat在book.html视图中打印出来。在每一次重复中,我都有一个动作按钮,用来打开模式来编辑或删除条目

这是我的book.html文件,其中嵌套了UI Bootsratp站点中的演示标记代码:

<h4 class="text-center"><strong>Book Collection</strong></h4>
<br>
<table class="table table-hover">
    <thead>
        <tr>
            <th>ID</th>
            <th>Image</th>
            <th>Title</th>
            <th>Author</th>
            <th>Year</th>
            <th>Publisher</th>
            <th>City of Publishing</th>
            <th>Genre</th>
            <th>Action
            <th>
        </tr>
    </thead>
    <tbody data-ng-init="init()">
        <tr data-ng-repeat="book in books">
            <td>{{book.id}}</td>
            <td>{{book.image}}</td>
            <td>{{book.title}}</td>
            <td>{{book.author}}</td>
            <td>{{book.yearOfPublishing}}</td>
            <td>{{book.publisher}}</td>
            <td>{{book.cityOfPublishing}}</td>
            <td>{{book.genre}}</td>
            <td><a class="btn btn-default" data-toggle="modal" data-ng-click="open()">Action</a></td>
        </tr>
    </tbody>
</table>

<div>
    <script type="text/ng-template" id="myModalContent.html">
        <div class="modal-header">
            <h3 class="modal-title">I'm a modal!</h3>
        </div>
        <div class="modal-body">
            <ul>
                <li ng-repeat="item in items">
                    <a ng-click="selected.item = item">{{ item }}</a>
                </li>
            </ul>
            Selected: <b>{{ selected.item }}</b>
        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" ng-click="ok()">OK</button>
            <button class="btn btn-warning" ng-click="cancel()">Cancel</button>
        </div>
    </script>
</div>  
我在页面加载时遇到此错误:

有人能帮我理解并在我的项目中实现modals吗?提前感谢……;)

加上这个

angular.module('Urapp', ['ui.bootstrap']);

在你的问题中,你写了
&modal
。那是打字错误吗?否则,这可能就是原因;)将modal更改为$modal应(&M)work@muenchdo是的,这是我在这篇文章中的打字错误,在我的项目中我尝试了$modal。我现在将编辑我的帖子,并对这篇编辑文章进行修改。谢谢你的通知。这是我在这篇文章中的打字错误,在我的项目中我尝试了$modal。我现在编辑了我的文章,并做了一个编辑笔记。@PapiTheTypecatser,你仍然会遇到同样的错误?是的,这只是一篇文章的输入错误,在我的IDE中,当我测试程序时,我输入了正确的$modal,但当我在这篇文章中编写代码时,我的脑海里充满了疑惑,我输入了&modal而不是$modal。错误仍然是一样的。@PapiTheTypecatser:是否包含ui.bootstrapangular.module('Urapp',['ui.bootstrap']);'
collectionsApp.controller('bookController', function($scope, bookService,
        $state, $modal) {

    var books = [];
...
angular.module('Urapp', ['ui.bootstrap']);