Inside my angular controller, I am defining a stringTemplate
containing expressions like "{{data.a}} - {{data.b}}". Along with that, I have an object named data
with values {a: "example1", b: "example2"}.
My goal is to find a way to replace the dynamic expressions in stringTemplate
with static values from data
. Essentially, the end result should be "example1 - example2"
.
I also need to ensure that this processed string can be stored in a database and retrieved later, even when the original data
object is no longer available.
Please note that both the values within data
and the content of stringTemplate
will be subject to change over time.