angularjsangular-materialng-dialog

Angular Material Dialog popup not showing


So when I click the button, my whole browser window goes black and there isn't any popup showing up. When I inspect element. I can see the outline of the pop up when my mouse hover overs 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>

Solution

  • you have to define DialogController.

    add this to your code:

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