Data Properties
Data Properties hold the state of our component.
Defining Data Properties
Data Properties are defined by creating a data structure on your component and assigning each property a default value.
Single or double quotes must surround property names.
JavaScript is a case-sensitive language, and CFML isn't. To preserve the casing of your property names, you must surround them with quotes.
Data Properties are parsed by JavaScript and can, therefore, only store JavaScript-friendly values: strings, numerics, arrays, structs, or booleans.
Data Properties are visible to JavaScript. You SHOULD NOT store sensitive data in them.
Default Values
Data properties should be assigned a default value, even if it's just an empty string.
Actions
You can access Data Properties from within your component Actions like so.
Templates
You can reference Data Properties within your component template using #propertyName#.
Resetting Properties
You can reset properties to their original default value inside your Actions using reset().
You can reset individual or all Data Properties.
You also can reset all properties EXCEPT the properties you pass.
Last updated