angularjs模态视图没有显示

时间:2015-07-05 20:57:20

标签: angularjs twitter-bootstrap modal-dialog

我正试图在角度js中显示确认模式,但我没有得到所需的结果:

这是我的代码:

$scope.deleteModal = function(item_id) {
     var post = list_item.getItem(item_id).then(function(item){
        $scope.item = item;
        console.log(JSON.stringify(item));
        var modalInstance = $modal.open({
              templateUrl: '../popup/delete.html',
              controller: $scope.modal,
              size: 'sm',
              resolve: {
                item: function () {
                  return $scope.item;

                }
              }
            });
        },function(msg){
            alert(msg);
        })
    };

$scope.modal = function($scope, $modalInstance, item) {

我正在接受我的观点,但不是我的模态 enter image description here

这是我的模态模板:

<div>
<div class="modal-header">
    <h4>@lang('messages.popup_delete')</h4>
</div>  

    <div class="modal-body">
       <p>@lang('messages.popup_del_q')  ?</p>
    </div>

<div class="modal-footer">
    <table>
           <tr>
               <td style="width:30px;"></td>
               <td style="width:120px;"><button   class="btn btn-danger" ng-click="delete(item.id)" >@lang('messages.confirm')</button></td>
               <td style="width:20px;"></td>
               <td><button   class="btn btn-primary" ng-click="cancel()" >@lang('messages.cancel')</button></td>
           </tr>
    </table>
</div>

1 个答案:

答案 0 :(得分:0)

看起来您在模板的末尾缺少结束</div>标记。 (或者只删除第一个开头<div>标记)。

相关问题