function createMenu(){ return /*html*/ `

`; } function updateViewHome(){ document.getElementById('app').innerHTML = /*HTML*/ `

Velkommen til Vinlotterix

${createMenu()} `; } function updateViewRules(){ app.innerHTML = /*HTML*/ `

Hello from rules

${createMenu()}
  1. Nummer: ${model.input.rules.numWinners}

`; } function editList(){ let html = ''; const employees = model.employees; for (let i = 0; i < employees.length; i++){ const person = employees[i]; html += /*html*/ `
  • ${person.id}${person.name}
  • `; } app.innerHTML = html + 'This is the list ' } function showWinnersView(){ let winners = []; let num = model.input.rules.numWinners; app.innerHTML = /*html*/ `

    Vinlotterix


    ${createMenu()}

    Vinnere:

    `; for (i = 0; i < num; i++){ index = Math.floor(Math.random() * (model.employees.length)); winners.push(model.employees[index]); } for (i = 0; i < winners.length; i++){ app.innerHTML += /*html*/ `

    ${winners[i].name}

    `;} } function goToEditPage(id){ const person = model.employees[id]; let newPerson = ''; app.innerHTML = /*html*/ `

    Endre eller slett


    ${createMenu()} Navn:
    `; } function changeList(id,name){ console.log(id,name) model.employees[id].name = name; console.log(model.employees[id].name) }