1

Basically I am working with a json object that I know nothing about, I don't know its keys, I don't know its value. I managed get work with it and process all the information that I want, at the end I have an array (I need an array to be able to do what I want) with all the keys and their paths in the json. Is there a way I can put it back in a json and display it using html ?

2
  • 1
    What have you tried? We only know as much as you know about the problem Commented Oct 19, 2017 at 15:46
  • Well, I am still trying to find answers on the internet and figure out an answer Commented Oct 19, 2017 at 15:49

2 Answers 2

3

If you don't want to use a devTool to display your json Object you can do this in your template :

<div>{{ yourObject | json}}</div>
Sign up to request clarification or add additional context in comments.

1 Comment

or even better wrap it in <pre></pre> as the json filter will do newlines and indentation for you.
0

Step 1:
Simple Javascript: const arrayAsJson = JSON.stringify(yourArray)

Step 2: To display the data follow the answer from @Bougarfaoui El houcine and as mentioned in the comments to get a formated output:

<pre>{{ arrayAsJson | json }}</pre>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.