Comment gérer une INSTRUCTION if dans une Moustache modèle?

Je suis en utilisant la moustache. Je suis de la génération d'une liste de notifications. Une notification objet JSON ressemble:

[{"id":1364,"read":true,"author_id":30,"author_name":"Mr A","author_photo":"image.jpg","story":"wants to connect","notified_type":"Friendship","action":"create"}]

Avec moustache, comment puis-je faire une instruction if ou cas fondée sur la notified_type & action...

Si notified_type == "Friendship" rendu ......

Si notified_type == "Other && action == "invite" rendu.....

Comment cela fonctionne?

InformationsquelleAutor AnApprentice | 2011-12-18