hyTags
HomeHome DocumentationDocumentation

property-set

Sets the value of a property in the current scope
Parameter
Type
Description
name
String
The name of the property to set
value
T?
The value to set for the property
return
void
No return value
Test Case:Set property value
    <div>
      <property name="testProp" type="string" value="hello"></property>
    </div>
    
    <property-set name="testProp" value="world">
    <property-get name="testProp">
    <assert-equal value="world" type="string">
    
    👆 Try to change something!
  • Test Case:Set property value from child element
      <div>
        <property name="testProp" type="string" value="hello"></property>
        <div class="child"></div>
      </div>
      
      <selection-change first-descendant=".child">
      <property-set name="testProp" value="world">
      <property-get name="testProp">
      <assert-equal value="world" type="string">
      
      👆 Try to change something!
    • Test succeeded Test failed