Javascript 角度7甜警报显示动态表

Javascript 角度7甜警报显示动态表,javascript,angular,sweetalert,sweetalert2,Javascript,Angular,Sweetalert,Sweetalert2,我正在使用Sweet alert 2和Angular 7,并尝试显示动态表 Json: 我尝试过使用*ngFor,但不幸的是,它不起作用 Swal({ position: 'center', type: 'info', title: `Class Information`, html: `<table> <tr> <th>Name</th> <th>Age</th> </tr&g

我正在使用Sweet alert 2和Angular 7,并尝试显示动态表

Json:

我尝试过使用*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({
位置:'中间',
键入:“info”,
标题:`类信息',
html:`
名称
年龄
{{person.name}
{{person.age}
`,
});
我正在尝试显示我自己的组件

  Swal({
      position: 'center',
      type: 'info',
      title: `Class Information`,
      html: `<class-component [inputClassInformation]="classInformationJson"></class-component>`
    });
Swal({
位置:'中间',
键入:“info”,
标题:`类信息',
html:``
});
这也不管用

我的目标是显示以下弹出窗口:

对于Angular 7,您需要使用ngx-2来显示动态表


名称
年龄
{{person.name}
{{person.age}

感谢您的重播!这仍然不起作用,您可以发布stackblitz示例吗。@AmitBaranes您需要使用ngx-sweetalert2,我知道了!包装器div应该包含*swalPartial。非常感谢。你能分享一下stackblitz演示吗?我试图解决这个问题。是否可以使用Sweet alert 2?我发布这个问题已经有一段时间了。。由于sweet alert不是我的正确选择,我最终使用了一个有角度的材质表。希望它能帮助你:)好的,没问题,但你知道这个问题,我真的需要帮助。
  Swal({
      position: 'center',
      type: 'info',
      title: `Class Information`,
      html: `<class-component [inputClassInformation]="classInformationJson"></class-component>`
    });