Parcourir la source

Improved main doc string of Template class.

Aleksander Nowodzinski il y a 9 ans
Parent
commit
5640aeaacb
1 fichiers modifiés avec 18 ajouts et 2 suppressions
  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' );
 
 /**
- * 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
  */