如何重用角度组件>> [

问题描述 投票:0回答:1
我用选择器创建了一个名为table的组件

<table class="table border-primary"> <thead> <tr> <th scope="col">#</th> <th scope="col">FirstName</th> <th scope="col">LastName</th> <th scope="col">UserName</th> <th scope="col">NickName</th> </tr> </thead> <tbody> <tr *ngFor="let monitor of details"> <th scope="row">3</th> <td>{{monitor.first}}</td> <td>{{monitor.last}}</td> <td>{{monitor.lastone}}</td> <td>{{monitor.second last}}</td> </tr> </tbody> </table>

我已经通过使用选择器重用了组件

table-2.component.html

<app-table></app-table>
它提供与上面创建的输出相同的输出。在扇区中,如何传递HTTP调用以便插值有效?

我用选择器创建了一个名为table的组件

#[>] ...] >>
确定,代码不足,但我想我已满足您的要求。

您需要向@Input提供app-table,然后对该值使用*ngFor

html angular angularjs-directive angular-material
1个回答
0
投票
确定,代码不足,但我想我已满足您的要求。
© www.soinside.com 2019 - 2024. All rights reserved.