M
M
Mikhail Oznobikhin2019-07-04 20:04:49
Angular
Mikhail Oznobikhin, 2019-07-04 20:04:49

How to modify json in angular?

I get json from the server in the form { "Name1": "Link1" , "Name2": "Link2", }. How in angular8 to convert it to an array of elements with fields
{name : Name1
link: Link1}
For further output in the template, if using regular expressions, then how to use them in Angular 8?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Oznobikhin, 2019-07-05
@where_is__your__god

Solved the problem like this
this.mass = Object.keys(json).map(key => ({name: key, link: json[key]}));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question