Answer the question
In order to leave comments, you need to log in
Response from server to array / parse response?
There is a response from the server like
..."content":{
"rendered":
"<h2>Вопрос1</h2><p>Ответ1</p>
<h2>Вопрос2</h2><p>Ответ2</p>
<h2>Вопрос3</h2><p>Ответ4</p>"
}...
<p-accordion>
<p-accordionTab header="{header}">
{content}
</p-accordionTab>
</p-accordion>
headers = [вопрос1,вопрос2,вопрос3];
contents = [ответ1,ответ2,ответ3];
Answer the question
In order to leave comments, you need to log in
You need to parse into a multidimensional array:
array = [
{
'header':'header1',
'contents':'contents1'
},
{
'header':'header2',
'contents':'contents2'
},
....
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question