$mdDialog
无法使用自定义模板。
这是代码:
HTML:
<md-button class="md-icon-button" ng-click="commentPrompt($event)">
<p>button
</p>
</md-button>
&#13;
JS:
var app = angular.module('BetaApp', ['ngMaterial', 'firebase']);
app.controller('SideNavController', function($scope, $mdDialog) {
$scope.commentPrompt = showDialog;
function showDialog($event){
var parentEl = angular.element(document.body);
$mdDialog.show({
parent: parentEl,
targetEvent: $event,
templateUrl: 'comment.html',
controller: DialogController
});
};
function DialogController($scope, $mdDialog) {
$scope.closeDialog = function() {
$mdDialog.hide();
}
}
});
&#13;
COMMENT.HTML:
<md-dialog>
<span>test
</span>
<md-button ng-click="closeDialog()" class="md-primary">
<p>close</p>
</md-button>
</md-dialog>
&#13;
答案 0 :(得分:0)
更改此
md-button class="md-icon-button" ng-click="commentPrompt($event)">
到
md-button class="md-icon-button" ng-click="showDialog($event)">