在此示例中,我将角材料表与扩展面板组合在一起。我可以单击并展开行。 https://stackblitz.com/angular/keapqmllkjp?file=app%2Ftable-expandable-rows-example.ts 为了创建切换事件,该代码中要进行哪些更改?
非常感谢!
答案 0 :(得分:0)
我想您是从Angular的官方文档中引用了您的示例。
https://stackblitz.com/angular/qvokovdpnlx?file=app%2Ftable-expandable-rows-example.ts
“ table-expandable-example.html”中第32行的源代码错误。
错误: (click)=“ expandedElement = element”
正确: (click)=“ expandedElement = expandElement ===元素?null:元素”