Created
February 14, 2020 22:22
-
-
Save koras/f16ddf4c41391a5167e0edbb7d64625c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CardList { | |
constructor(element) { | |
this.list = []; | |
this.element = element; | |
} | |
/** | |
* генерируем карточки | |
* @param {*} initialCard | |
*/ | |
render(initialCard) { | |
for (const elCard of initialCard) { | |
const card = new Card(); | |
const html = card.render(elCard); | |
this.list.push(card); | |
} | |
} | |
/** | |
* Добавляем в DOM | |
* @param {*} html | |
*/ | |
addHtml(html) { | |
this.element.insertAdjacentHTML('afterend', html); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment