Angular Material 对话框弹出未显示

5

当我点击这个按钮时,整个浏览器窗口会变成黑色,并且没有任何弹出窗口显示。当我检查元素时,鼠标悬停在上面时可以看到弹出窗口的轮廓,但内容不显示。

app.controller('HomeController', function($scope, $timeout, mapboxService, $mdDialog) {
   $scope.showAdvanced = function(ev){
    $mdDialog.show({
        controller: DialogController,
        templateUrl: 'views/reviewForm.html',
        parent:angular.element(document.body),
        targetEvent: ev,
        clickOutsideToClose:true
    })
};
});

html

<div id="popupContainer">
   <md-button ng-click="showAdvanced($event)" flex="100">Add a Review</md-button>
 </div>

reviewForm html

<md-dialog>
<md-dialog-content>

    <h1>;lkasdjf;lkasdjf;lkajsdf;lkajdf</h1>

</md-dialog-content>
</md-dialog>

根据您上面展示的内容无法重现。问题可能是由其他原因引起的,也许是您的CSS? ~ http://plnkr.co/edit/m9slJdMh5hiBYKBvwQth?p=preview。 - Phil
1个回答

1
你需要定义DialogController。
在你的代码中添加以下内容:
function DialogController($scope, $mdDialog) {

//whatever functions you want to define

}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接