Hey i am getting data from a JSON URL, this is my sample data,
I want to display all “text” in a paragraph,like
" بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ لْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ الرَّحْمَٰنِ الرَّحِيمِ "
I am using ngFor. Please help… Thank You
<ion-list>
<ion-item *ngFor="let ayah of ayahs">
{{ayah.text}}
</ion-item>
</ion-list>
I want to display data in a paragraph, by your logic data is showing like this,
Oh, so like concat all of the text
data?
In that case in the controller I’d do:
public text = "";
Then when you get the data do:
this.text = ayahs.reduce((str, ayah) => str + ayah.text, "");
Then in your template you can just do:
<p>{{text}}</p>
Could you do this with my logic, i can’t understand your logic.
View on HTML:
TS Data:
I am getting my required data in “this.frest”
Sorry if i sound silly