Fuel
Fuel

Reputation: 21

How do i show Objects in PUG Template Engine?

I'm working with NodeJS, Express and some Modules. Now I'm stuck at a Problem with the PUG Template Engine. I cant show my Object that I get from flash messages.

Im sure that I get an Answer of my Process, because I have an Object with the Data I want to show

enter image description here

But I'm unable to show this Data in my Browser. My Code looks like this at the moment.

if message
        div(class='alert alert-danger alert-dismissable', style='width: 100%;')
        button(class='close', data-dismiss='alert') ×
              div(class='row', style='padding-top: 10px; padding-left: 15px;')
                  span(class='oi oi-warning', style='padding: 2px;')                         
                       strong Fehler!
                       hr(class='horizontal-divider')
                       div(class='row', style='padding-left: 15px;')
                              p= message.username
                              p= message.password

Upvotes: 1

Views: 511

Answers (1)

Gibin Ealias
Gibin Ealias

Reputation: 2859

First of all, you are checking if message in the first line, whereas in the response its msg.

Secondly, make sure you are pointing the msg object correctly, like array.[0].username.msg.

Hope this helps.

Upvotes: 1

Related Questions