From e470ac51ec20d3435b7eaabb2dff3b2eb3433a9c Mon Sep 17 00:00:00 2001 From: Marek Lewandowski Date: Fri, 3 Apr 2020 12:55:47 +0200 Subject: [PATCH] Docs: Adjusted code snippet for the view#createCollection() method. --- src/view.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/view.js b/src/view.js index 2fc2280c..6a55ad8e 100644 --- a/src/view.js +++ b/src/view.js @@ -253,7 +253,8 @@ export default class View { * constructor( locale ) { * super( locale ); * - * this.items = this.createCollection(); + * const child = new ChildView( locale ); + * this.items = this.createCollection( [ child ] ); * * this.setTemplate( { * tag: 'p', @@ -265,17 +266,11 @@ export default class View { * } * * const view = new SampleView( locale ); - * const child = new ChildView( locale ); - * * view.render(); * - * // It will append

to the . + * // It will append

to the . * document.body.appendChild( view.element ); * - * // From now on the child is nested under its parent, which is also reflected in DOM. - * //

- * view.items.add( child ); - * * @param {Iterable.} [views] Initial views of the collection. * @returns {module:ui/viewcollection~ViewCollection} A new collection of view instances. */