Преглед на файлове

Minor fixes to ViewCollection docs.

Aleksander Nowodzinski преди 9 години
родител
ревизия
5d68552e4b
променени са 1 файла, в които са добавени 9 реда и са изтрити 3 реда
  1. 9 3
      packages/ckeditor5-ui/src/viewcollection.js

+ 9 - 3
packages/ckeditor5-ui/src/viewcollection.js

@@ -111,11 +111,17 @@ export default class ViewCollection extends Collection {
 	 * TODO: Example and longer explanation. Probably imported from ControllerCollection#bind.
 	 *
 	 * @param {utils.Collection} collection A collection to be bound.
-	 * @returns {Function} return.CallbackOrViewClass Specifies the constructor of the view to be used or
-	 * a custom callback function which produces views.
+	 * @returns {ui.ViewCollection.bindTo#as}
 	 */
 	bindTo( collection ) {
 		return {
+			/**
+			 * Determines the output view of the binding.
+			 *
+			 * @method ui.ViewCollection.bindTo#as
+			 * @param {Function|ui.View} CallbackOrViewClass Specifies the constructor of the view to be used or
+			 * a custom callback function which produces views.
+			 */
 			as: ( CallbackOrViewClass ) => {
 				let createView;
 
@@ -166,7 +172,7 @@ export default class ViewCollection extends Collection {
 	 *		const viewB = new View();
 	 *		const viewC = new View();
 	 *
-	 *		const views = new ViewCollection( 'name' );
+	 *		const views = parentView.createCollection();
 	 *
 	 *		views.delegate( 'eventX' ).to( viewB );
 	 *		views.delegate( 'eventX', 'eventY' ).to( viewC );