Skip to content

Commit

Permalink
Merge pull request #5115 from Polymer/fix-templatizer-docs
Browse files Browse the repository at this point in the history
Fix issue with not genering the Templatizer docs
  • Loading branch information
TimvdLippe authored Feb 15, 2018
2 parents bcfd37a + 63e7bbc commit 6b47124
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/utils/templatize.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@
* @summary Module for preparing and stamping instances of templates
* utilizing Polymer templating features.
*/

const Templatize = {
Polymer.Templatize = {

/**
* Returns an anonymous `Polymer.PropertyEffects` class bound to the
Expand Down Expand Up @@ -571,7 +570,6 @@
}
};

Polymer.Templatize = Templatize;
Polymer.TemplateInstanceBase = TemplateInstanceBase;

})();
Expand Down
33 changes: 33 additions & 0 deletions types/lib/utils/templatize.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,39 @@ declare namespace templateInfo {

declare namespace Polymer {

/**
* Module for preparing and stamping instances of templates that utilize
* Polymer's data-binding and declarative event listener features.
*
* Example:
*
* // Get a template from somewhere, e.g. light DOM
* let template = this.querySelector('template');
* // Prepare the template
* let TemplateClass = Polymer.Templatize.templatize(template);
* // Instance the template with an initial data model
* let instance = new TemplateClass({myProp: 'initial'});
* // Insert the instance's DOM somewhere, e.g. element's shadow DOM
* this.shadowRoot.appendChild(instance.root);
* // Changing a property on the instance will propagate to bindings
* // in the template
* instance.myProp = 'new value';
*
* The `options` dictionary passed to `templatize` allows for customizing
* features of the generated template class, including how outer-scope host
* properties should be forwarded into template instances, how any instance
* properties added into the template's scope should be notified out to
* the host, and whether the instance should be decorated as a "parent model"
* of any event handlers.
*
* // Customize property forwarding and event model decoration
* let TemplateClass = Polymer.Templatize.templatize(template, this, {
* parentModel: true,
* forwardHostProp(property, value) {...},
* instanceProps: {...},
* notifyInstanceProp(instance, property, value) {...},
* });
*/
namespace Templatize {


Expand Down

0 comments on commit 6b47124

Please sign in to comment.