I have this object called obj in my pug template
{
"property1": {
"property1": {
"property1": "value",
"property2": "value",
"property3": "value"
},
"property2": "value",
"property3": "value"
},
"property2": "value",
"property3": "value"
}
If i do
pre=obj
The object is displayed correctly. But if I want to access its nested properties like
pre=obj.property1.property1
For some reasons its not rendering.
Same if I do p=obj.property1.property1.property1
What am I missing? Thanks
Here is my exact code snippet:
.box-body
-session_details.forEach(function(session_detail) {
.row
.col-md-1=moment(session_detail.create_time).calendar()
.col-md-1=moment(session_detail.create_time).format("DD/MM/YYYY HH:MM:SS")
.col-md-1=session_detail.intent
.col-md-4
p #{session_detail.request.type}
pre=session_detail.request
.col-md-5
pre=session_detail.response
- });
And here is the exact output: https://i.stack.imgur.com/tx1Tt.jpg
As you can see, the p #{session_detail.request.type} is not displayed for some reasons.
It's been asked already but I don't have enough reputation to flag as duplicate.
To answer your question, use hash and curly braces.
I don't think you need the equal sign though.