Angular UI模式未显示

时间:2018-05-17 19:45:02

标签: javascript angularjs angular-ui-bootstrap

我正在尝试添加一个模式,当用户点击这样创建的元素时弹出该模式:

<li ng-repeat="task in tasks | filter:{Status: 0}" class="list-group-item list-group-item-danger" ng-click="getTask(task)">

这是getTask函数:

    $scope.getTask = function (task) {
        taskService.getTask(task.Id)
            .then(task => {
                var modalInstance = $uibModal.open({
                    animation: true,
                    templateUrl: "Content/partials/TaskModal.html",
                    controller: "taskModalController",
                    resolve: {
                        task: function () {
                            return task
                        }
                    }
                });

                modalInstance.result.then(task => {
                    if (task)
                        updateTask(task); 
                });
            })
    };

模板只是一个带有表单的div。

<div class="panel panel-primary">
    <div class="panel-heading">Edit Task</div>
    <div class="panel-body">
        <form name="EditTask" ng-submit="saveTask()" class="form-inline mb-5">
            <div class="form-group col-lg-4">
                <label for="Assignee">Assignee</label>
                <input type="text" name="Assignee" class="form-control" required ng-model="EditTask.Assignee" ng-minlength="5" />
            </div>
            <div class="form-group col-lg-4">
                <label for="Assignment">Assignment</label>
                <input type="text" name="Assignment" class="form-control" ng-model="EditTask.Assignment" required ng-minlength="5" />
            </div>
            <div class="form-group col-lg-4">
                <input type="submit" name="Save" value="Save" class="btn btn-success btn-lg"
                       ng-disabled="EditTask.$invalid" />
            </div>
        </form>
    </div>
</div>

单击元素时,实际创建了模态,但它完全不可见。当鼠标悬停在按钮上时,可以单击按钮并更改指针,并检查文件显示信息正确传递。

我在这里错过了什么阻止我展示这种模式?

编辑:

head我有CSS链接:

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" crossorigin="anonymous">

在身体的底部有脚本:

<script src="/bower_components/angular/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular-animate.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular-sanitize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/2.5.0/ui-bootstrap-tpls.min.js"></script>
<script src="~/Content/js/app.js"></script>
<script src="~/Content/js/directives.js"></script>

0 个答案:

没有答案