角度材质对话框弹出窗口未显示

时间:2015-10-29 00:34:21

标签: angularjs angular-material ng-dialog

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

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>

1 个答案:

答案 0 :(得分:1)

你必须定义DialogController。

将此添加到您的代码中:

function DialogController($scope, $mdDialog) {

//whatever functions you want to define

}