hyTags
HomeHome DocumentationDocumentation

fragment-replace

Replaces all occurrences of a placeholder string with a value in the fragment.
Parameter
Type
Description
self
Fragment
The fragment in which to perform the replacement.
placeholder
String
The string pattern to find and replace.
value
String
The string to replace the placeholder with.
return
void
Nothing.
Test Case:Replace placeholder in fragment
    <div></div>
    
    <fragment-from-string value="<div>{{name}}</div>">
    <fragment-replace placeholder="{{name}}" value="John"></fragment-replace>
    
    👆 Try to change something!
  • Test succeeded Test failed