An options communication utility API. Allows for sharing options between different components, but also between JavaScript and the DOM.
This utility is registered with Bower. To install simply execute the following command in the root of your project folder.
bower install --save-dev options-util
Use a script tag with type json/options
to store values inside the options util using JSON.
<script type="json/options">
{
"propertyName": "property value"
}
</script>
Sets a value.
- If the property was already set and both values are a string, the last call will override the previous value.
- If the property was already set and both values are objects, They will be merged.
options.set('propertyName', 'property value');
Returns a value that was previously set.
options.get('propertyName');
Deletes a value that was previously set.
options.remove('propertyName');
Check if property is set:
options.isSet('propertyName');