From cf5f818e609be9b3f3f716653edcfc44ec8b47b7 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Tue, 23 Jan 2018 11:30:14 -0800 Subject: [PATCH] Add comments re: instanceProps --- lib/utils/templatize.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/utils/templatize.html b/lib/utils/templatize.html index ec572c3090..4f50cf68bd 100644 --- a/lib/utils/templatize.html +++ b/lib/utils/templatize.html @@ -102,6 +102,8 @@ this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]); } } + // Any instance props passed in the constructor will overwrite host props; + // normally this would be a user error but we don't specifically filter them for (let iprop in props) { this._setPendingProperty(iprop, props[iprop]); } @@ -391,12 +393,11 @@ * // Customize property forwarding and event model decoration * let TemplateClass = Polymer.Templatize.templatize(template, this, { * parentModel: true, - * instanceProps: {...}, * forwardHostProp(property, value) {...}, + * instanceProps: {...}, * notifyInstanceProp(instance, property, value) {...}, * }); * - * * @namespace * @memberof Polymer * @summary Module for preparing and stamping instances of templates @@ -448,6 +449,15 @@ * from `instance.parentModel` in cases where template instance nesting * causes an inner model to shadow an outer model. * + * When `options.forwardHostProp` is declared as an option, any properties + * referenced in the template will be automatically forwarded from the host of + * the `