【发布时间】:2016-04-18 11:04:27
【问题描述】:
我正在使用 ng2-material 来构建我的 angular2 应用程序。 ng2-material 只提供了两种基本的对话组件,但我需要更改它们的内容。
所以我需要知道我该怎么做? 这就是我正在使用的
let config = new MdDialogConfig()
.textContent(``)
.clickOutsideToClose(true)
.title('')
.ariaLabel('Lucky day')
.ok('save')
.cancel('cancel')
.targetEvent(ev);
this.dialog.open(MdDialogBasic, this.element, config)
.then((ref: MdDialogRef) => {
ref.whenClosed.then((result) => {
if (result) {
this.status = 'You decided to get rid of your debt.';
}
else {
this.status = 'You decided to keep your debt.';
}
})
});
我无法识别 template URL 来代替 textContent,就像在 Angular 材料中一样:
$mdDialog.show({
controller: DialogController,
templateUrl: 'dialog1.tmpl.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true,
fullscreen: useFullScreen
})
【问题讨论】: