Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 659
Zach Turner Avatar asked Nov 09 '22 02:11

Zach Turner


1 Answers

you have to define DialogController.

add this to your code:

function DialogController($scope, $mdDialog) {

//whatever functions you want to define

}
like image 90
Mohamed dev Avatar answered Nov 15 '22 05:11

Mohamed dev