angular - How to Object Data from child component to parent component -


i want pass object data child component parent component.

<section class="grey_bg"> <app-search></app-search> <table>     <tbody>         <tr *ngfor="let contest of contests">             <td>{{contest.contest_date}}</td>             <td>{{contest.prize_pool}}</td>             <td>{{contest.points}}</td>             <td>${{contest.entry_fee}}</td>         </tr>     </tbody> </table> 

get data child component search component has selected app-search has contest data

this.authservice.getusercontests().subscribe(     contests => {       this.contests = contests.data      } 

the easiest ways share information between parent , child components can found in cookbook provided angular team.

the specific technique should focus on, output() via eventemitter described here.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

Command prompt result in label. Python 2.7 -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -