Answer the question
In order to leave comments, you need to log in
Passing data from one component to another in angular?
Actually there is a parent component and there is a child.
Some data comes to the parent, which I then display as a sign.
I need to pass the id of this record to the child component when clicking on a row.
Here I display the data
<div class="flex-table">
<div class="tbody">
<div class="tr" *ngFor="let item of searchResult" (click)=select(item.IDObekta)>
<div class="td">{{ item.StrahProdukt.NaimObekta }}</div>
<div class="td">{{ item.Nomer }}</div>
<div class="td">{{ item.DataPodpisaniya | date: 'dd-MM-yyyy' }}</div>
</div>
</div>
</div>
<b2b-acquiring *ngIf="selectContract"></b2b-acquiring>
search(contract: any) {
this.searching = true;
return this.apollo.query({
query: searchContractQuery,
variables: {
docnumber: contract.value.Nomer
},
fetchPolicy: 'network-only'
}).subscribe(({ data }) => {
this.searchResult = (data as any).contract.searchContract;
this.searching = false;
});
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question