Angular Material dialog box popup not showing

Therefore, when I click the button, my entire browser window turns black and the popup does not appear. When I check the item. I see the outline of a pop-up window when my mouse freezes over it, but the content is not there.

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> 
+5
source share
1 answer

you need to define a DialogController.

add this to your code:

 function DialogController($scope, $mdDialog) { //whatever functions you want to define } 
+1
source

Source: https://habr.com/ru/post/1234753/


All Articles