Angular Material 未显示对话框弹出窗口
Angular Material Dialog popup not showing
因此,当我单击该按钮时,我的整个浏览器 window 变黑了,并且没有任何弹出窗口出现。当我检查元素时。当我的鼠标悬停在弹出窗口上时,我可以看到弹出窗口的轮廓,但内容不在那里。
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>
审核表格html
<md-dialog>
<md-dialog-content>
<h1>;lkasdjf;lkasdjf;lkajsdf;lkajdf</h1>
</md-dialog-content>
</md-dialog>
你必须定义 DialogController。
将此添加到您的代码中:
function DialogController($scope, $mdDialog) {
//whatever functions you want to define
}
因此,当我单击该按钮时,我的整个浏览器 window 变黑了,并且没有任何弹出窗口出现。当我检查元素时。当我的鼠标悬停在弹出窗口上时,我可以看到弹出窗口的轮廓,但内容不在那里。
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>
审核表格html
<md-dialog>
<md-dialog-content>
<h1>;lkasdjf;lkasdjf;lkajsdf;lkajdf</h1>
</md-dialog-content>
</md-dialog>
你必须定义 DialogController。
将此添加到您的代码中:
function DialogController($scope, $mdDialog) {
//whatever functions you want to define
}