src/scripts/script.js
//Add transaction data to HTML document
Add transaction data to HTML document
Add transaction data to HTML document
innerHTMLTransaction(transaction, index) {
    const cssClass = transaction.amount > 0 ? "income" : "expense"
    const amount = Utils.formatCurrency(transaction.amount)
    const html = `
    <td class="description">${transaction.description}</td>
    <td class="${cssClass}">${amount}</td>
    <td class="date">${transaction.date}</td>
    <td><img onclick="manipulateDOM.editTransaction(${index})" src="./assets/edit.svg" alt="Editar Transação"></td>
    <td><img onclick="calculateTransactions.remove(${index})" src="./assets/minus.svg" alt="Remover Transação"></td>
    `
    return html;
  }
innerHTMLTransaction ( transaction , index ) { const cssClass = transaction . amount > 0 ? "income" : "expense" const amount = Utils . formatCurrency ( transaction . amount ) const html = ` ${ transaction . description } ${ cssClass } ${ amount } ${ transaction . date } ${ index } ${ index } ` return html ; }
Add transaction data to HTML document
Add transaction data to HTML document