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.
{ user: { first: 'Ada', last: 'Lovelace' }, count: 3 }{
$interpolate: {
template: 'Welcome, {{first}} {{last}}! You have {{count}} new messages.',
values: {
first: { $ref: '$.user.first' },
last: { $ref: '$.user.last' },
count: { $ref: '$.count' },
},
},
}'Welcome, Ada Lovelace! You have 3 new messages.'
Runs in this page on the installed package. The input and the expected output are defined by the example.