I have a button on click of which an md-dialog pops up. This dialog contains some rather heavy html and javascript and the first time the button is clicked, it takes about half a second to show the dialog (I'm guessing because the DOM is being created, since it doesn't happen again). Is there any way for me to avoid this lag?
UPDATE: I've narrowed down the problem to needing to pre-compile the template. How do I attach the compiled template to the dialog? Here's my dialog:
$mdDialog.show({
escapeToClose: true,
parent: parentEl,
targetEvent: $event,
templateUrl: "someurl", //This gets a big html file
locals: {
items: $scope.items
},
controller: ["$scope", "$mdDialog", DialogController]
});