0

I have the following code in Jade, and I am trying to translate it to EJS, but quite unfamiliar with Jade (Or ejs for that matter). I've started but not quite sure if I am doing it correctly. Also, why can't I just use normal javascript in ejs rather than using the syntax which is quite confusing ? thank you! convert jade to ejs .

extends ../layouts/default/layout

block content
  div.row
    div.col-md-12
      h2= title
      hr
      if info != undefined
        div.form-group
          div.col-lg-12
            div.alert.alert-dismissible.alert-info
              button.close(type='button', data-dismiss='alert') ×
              strong Excelente!
              p= info
      table.table.table-striped.table-hover#tblTasks
        thead
          tr
            th #
            th Titulo
            th Descripcion
            th Prioridad
            th Fecha
            th Estado
            th Acciones
        tbody
          each task in tasks
            tr(id='row#{task.id}')
              td= task.id
              td= task.title
              td= task.description
              td= task.priority
              td= task.date
              td= task.status
              td
                a(href='tasks/update/#{task.id}', class='btn btn-xs btn-success', style='margin-right: 3px;') Editar
                button(onclick='deleteTask(#{task.id});', class='btn btn-xs btn-danger') Eliminar

  script(src='/javascripts/tasks.js')
spark-19
  • 1
  • 2
  • Welcome to Stack Overflow! Please review our [SO Question Checklist](https://stackoverflow.com/help/how-to-ask) to help you to ask a good question, and thus get a good answer. – Heri May 05 '18 at 15:59
  • lease clarify what is the problem, what you expect and what you get instead. – Heri May 05 '18 at 15:59
  • You have a error in looping not in ejs or jade. Refer this question https://stackoverflow.com/questions/31764552/ejs-how-to-iterate-object?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Aniketh Saha May 05 '18 at 16:50
  • I think there may be missing `;` near `)` – Aniketh Saha May 05 '18 at 16:51

0 Answers0