0

I have a json response as :

{ someText: "Order in {000} 12pm PST for early shipping"; cutofftime : "10000000" }

What is the best approach to replace the '{000}' by the "cutofftime". Here the cutofftime is dynamic and the "someText" is static. I am using Angular 12.

I tried : this.orderCutOffMessage = Order in ${{ cutofftime }} 12pm PST for early shipping; which does not work and also the first and last part of the this.orderCutOffMessage should also come from the json response,

0

1 Answer 1

2

this.orderCutOffMessage = (yourJSONresponseVar).someText.replace('{000}',(yourJSONresponseVar).cutofftime);

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.