Y
Y
Yuri Kizilov2018-01-02 12:44:53
Pug
Yuri Kizilov, 2018-01-02 12:44:53

Checking in Pug/Jade?

Hey! The question is this:
- In pug, from the json file, in which the array of objects is located, data is pulled into certain tags. Is it possible to check if there is a given key in the object - display the tag along with the data, if there is no key in the object - do not display the tag?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Kizilov, 2018-01-02
@Kizilov

Solved
- var anchor = data.anchor
- if (anchor !== undefined)
a(href='http://' + anchor)= anchor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question