Skip to content

Commit

Permalink
Allow hybrid elements (like iron-list) to make template instances wit…
Browse files Browse the repository at this point in the history
…h mutable data
  • Loading branch information
keanulee committed Mar 7, 2017
1 parent 8fd1b21 commit ea392e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<link rel="import" href="../utils/import-href.html">
<link rel="import" href="../utils/render-status.html">
<link rel="import" href="../utils/unresolved.html">
<link rel="import" href="mutable-data-behavior.html">
<link rel="import" href="polymer.dom.html">

<script>
Expand Down
6 changes: 5 additions & 1 deletion lib/legacy/templatizer-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@
* by `stamp` to create new instances of the template.
*
* @param {HTMLTemplateElement} template Template to prepare
* @param {Boolean=} mutableData When `true`, the generated class will skip
* strict dirty-checking for objects and arrays (always consider them to
* be "dirty"). Defaults to false.
* @return {TemplateInstance} Description
*/
templatize(template) {
templatize(template, mutableData) {
this._templatizerTemplate = template;
this.ctor = Polymer.Templatize.templatize(template, this, {
mutableData: Boolean(mutableData),
parentModel: this._parentModel,
instanceProps: this._instanceProps,
forwardHostProp: this._forwardHostPropV2,
Expand Down
3 changes: 3 additions & 0 deletions lib/utils/templatize.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@
* to the instance by the templatize owner. These properties shadow any
* host properties, and changes within the template to these properties
* will result in `notifyInstanceProperties` to be called.
* - `mutableData`: When `true`, the generated class will skip strict
* dirty-checking for objects and arrays (always consider them to be
* "dirty").
* - `notifyInstanceProperties(instance, property, value)`: Called when
* an instance property changes. Users may choose to call `notifyPath`
* on e.g. the owner to notify the change.
Expand Down

0 comments on commit ea392e3

Please sign in to comment.