1

I have to display a dynamic Json response coming from the server which looks something like this

{
  responseBody: {
    menu: {
      id: 'file',
        value: 'File',
      },
    },
  }
  status: 200,
}

I am parsing the responseBody string to pretty print it. But, I have to display the responseBody (which can be JSON, XML or string) with line numbers like this Picture example

How can display this response along with the line number?

1
  • do not post pictures with code, attach the code Commented Apr 29, 2020 at 11:52

1 Answer 1

2

I think you can use the module ngx-highlightjs to do this.

ngx-highlightjs NPM

Stackblitz Example

Sign up to request clarification or add additional context in comments.

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.