Prism · Strings

$interpolate

Fills the {{key}} placeholders of a template with the matching values. The template is written out; values is an object of expressions, or one expression that gives an object.

The source
{ user: { first: 'Ada', last: 'Lovelace' }, count: 3 }
The config
{
  $interpolate: {
    template: 'Welcome, {{first}} {{last}}! You have {{count}} new messages.',
    values: {
      first: { $ref: '$.user.first' },
      last: { $ref: '$.user.last' },
      count: { $ref: '$.count' },
    },
  },
}
What comes out
'Welcome, Ada Lovelace! You have 3 new messages.'
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.