【发布时间】:2019-03-13 10:29:25
【问题描述】:
我正在使用带有 Angular 7 的 Sweet alert 2,并且我正在尝试显示动态表格。
json:
[
{
"name": "Steve",
"age": 23
},
{
"name": "John",
"age": 30
},
{
"name": "Daniel",
"age": 18
}
]
我曾尝试使用 *ngFor,但不幸的是,它不起作用。
Swal({
position: 'center',
type: 'info',
title: `Class Information`,
html: `<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr *ngFor="let person of persons">
<td>{{person.name}}</td>
<td>{{person.age}}</td>
</tr>
</table>`,
});
我正在尝试显示我自己的组件。
Swal({
position: 'center',
type: 'info',
title: `Class Information`,
html: `<class-component [inputClassInformation]="classInformationJson"></class-component>`
});
这也不行。
【问题讨论】:
-
可以使用 Sweet alert 2 吗?
-
自从我发布这个问题已经有一段时间了。我最终使用了一个有角度的材料表,因为甜警报对我来说不是正确的选择。希望对你有帮助:)
-
好的,没问题,但你知道这个问题吗,我真的需要帮助。
标签: javascript angular sweetalert sweetalert2