Bladeren bron

Improved main doc string of Template class.

Aleksander Nowodzinski 9 jaren geleden
bovenliggende
commit
5640aeaacb
1 gewijzigde bestanden met toevoegingen van 18 en 2 verwijderingen
  1. 18 2
      packages/ckeditor5-ui/src/template.js

+ 18 - 2
packages/ckeditor5-ui/src/template.js

@@ -16,9 +16,25 @@ const bindToSymbol = Symbol( 'bindTo' );
 const bindIfSymbol = Symbol( 'bindIf' );
 const bindIfSymbol = Symbol( 'bindIf' );
 
 
 /**
 /**
- * Basic Template class.
+ * A basic Template class. It renders DOM HTMLElements from {@link ui.TemplateDefinition} and supports
+ * element attributes, children, bindings to {@link utils.ObservableMixin} instances and DOM events
+ * propagation. For example:
  *
  *
- * See {@link ui.TemplateDefinition}.
+ *		new Template( {
+ *			tag: 'p',
+ *			attributes: {
+ *				class: 'foo'
+ *			},
+ *			children: [
+ *				'A paragraph.'
+ *			]
+ *		} ).render();
+ *
+ * will render the following HTMLElement:
+ *
+ *		<p class="foo">A paragraph.</p>
+ *
+ * See {@link ui.TemplateDefinition} to know more about templates and see complex examples.
  *
  *
  * @memberOf ui
  * @memberOf ui
  */
  */