Polymer behavior for resetting properties

[ This description is mirrored from README.md at github.com/danielx/resettable-properties-behavior on 2019-05-22 ]

Published on webcomponents.org

ResettablePropertiesBehavior

ResettablePropertiesBehavior lets you easily reset polymer element properties to their default values.

ResettablePropertiesBehavior require properties that use this behavior to have a function as their value.

Set resettable to true for properties to reset them with resetProperties.

data: {
  type: Array,
  resettable: true,
  value: function() {
    return [];
  }
}

Optionally set resetGroups to only reset a subset of resettable properties with resetPropertyGroup(group).

data: {
  type: Array,
  resettable: true,
  resetGroups: ['group-name'],
  value: function() {
    return [];
  }
}

Install

Link to this version
ImportedReleased 19 July 2017MIT License
Framework Support
Polymer 2.0+
Also supported:
Polymer 1 (0.1.1)
Browser Compatibility
Install with
bower install --save danielx/resettable-properties-behavior"#0.1.2"
Run the above Bower command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 0.1.2

Dependencies

  • polymer#Polymer/polymer#1 - 2