admin管理员组文章数量:1125445
I'm new to Angular and trying to create a reusable table component. The test label below displays the passed column value without issue but the table rows never appear. However, if I copy paste the table component code directly to the page I'm calling my reusable component from, the head row appears without issue.
I've been testing this like crazy and I can't see why the data can make the leap to the label but not to the table.
Here's the HTML for my reusable component -
<label [innerText]="columns[2]"></label>
<p-table [columns]="columns">
<ng-template pTemplate="header" let-columns>
<tr>
<th *ngFor="let col of columns">
{{col}}
</th>
</tr>
</ng-template>
</p-table>
Here is how I have the input declared -
export class ReusableTableComponent implements OnInit {
@Input() columns :string[]= [];
ngOnInit(): void {
}
}
本文标签: angularReusable Table Not Receiving Passed DataStack Overflow
版权声明:本文标题:angular - Reusable Table Not Receiving Passed Data - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736622506a1945606.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论