Parcourir la source

Code refactorin and documentation in Template class.

Aleksander Nowodzinski il y a 9 ans
Parent
commit
a951b7fb94
1 fichiers modifiés avec 9 ajouts et 5 suppressions
  1. 9 5
      packages/ckeditor5-ui/src/template.js

+ 9 - 5
packages/ckeditor5-ui/src/template.js

@@ -772,8 +772,12 @@ function isBound( valueSchema ) {
  */
 
 /**
- * Describes a value of HTMLElement attribute or `textContent`.
- * See: {@link ui.TemplateDefinition}.
+ * Describes a value of HTMLElement attribute or `textContent`. See:
+ *  * {@link ui.TemplateDefinition},
+ *  * {@link ui.Template.bind.binder#to},
+ *  * {@link ui.Template.bind.binder#if}.
+ *
+ *		const bind = Template.bind( observableInstance, emitterInstance );
  *
  *		new Template( {
  *			tag: 'p',
@@ -782,19 +786,19 @@ function isBound( valueSchema ) {
  *				class: 'static-text'
  *
  *				// Object schema, an `ObservableMixin` binding.
- *				class: {@link ui.TemplateBinding}
+ *				class: bind.to( 'foo' )
  *
  *				// Array schema, combines the above.
  *				class: [
  *					'static-text',
- *					{@link ui.TemplateBinding}
+ *					bind.to( 'bar', () => { ... } )
  *				],
  *
  *				// Array schema, with custom namespace.
  *				class: {
  *					ns: 'http://ns.url',
  *					value: [
- *						{@link ui.TemplateBinding},
+ *						bind.if( 'baz', 'value-when-true' )
  *						'static-text'
  *					]
  *				}