I'm using mustache. I'm generating a list of notifications. A notification JSON object looks like:
[{"id":1364,"read":true,"author_id":30,"author_name":"Mr A","author_photo":"image.jpg","story":"wants to connect","notified_type":"Friendship","action":"create"}]
With mustache, how can I do a if statement or case statement based on the notified_type
& action
...
If notified_type == "Friendship"
render ......
If notified_type == "Other && action == "invite"
render.....
How does that work?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…