【发布时间】:2019-04-12 13:36:20
【问题描述】:
我正在使用 MatDialog 并尝试在内容定义中添加新行。 \n 和 </b> 都没有这样做。由于它是可重用组件,因此是否有另一种方法而无需手动进入 html 并对其进行更改:
var status: MatDialogRef<GenericDialogComponent> this.dialog.open(GenericDialogComponent,{
width: '400px',
data: {title: "Sample Title?", content: "Document " + this.docID + " has been saved. The users email address is provied below:\n\n"+this.email+"</b>"} });
HTML
<h1 mat-dialog-title>{{data.title}}</h1>
<div mat-dialog-content>
<p>{{data.content}}</p>
</div>
<div mat-dialog-actions>
<button mat-button (click)="Cancel()">Cancel</button>
<button mat-button (click)="Ok()" cdkFocusInitial>Ok</button>
</div>
【问题讨论】:
-
简单
也不起作用?我假设它不需要 HTML -
不,它不起作用,它确实需要 html
标签: javascript angular angular-material