我正在使用小胡子。我正在生成通知列表。通知JSON对象的样子:如何处理小胡子模板中的IF语句?
[{"id":1364,"read":true,"author_id":30,"author_name":"Mr A","author_photo":"image.jpg","story":"wants to connect","notified_type":"Friendship","action":"create"}]
有了胡子,我该怎么办基础上,notified_type &行动if语句或case语句......
如果notified_type ==“友谊”渲染.. ....
如果notified_type ==“其他& &行动== “邀请” 渲染.....
是如何运作的?
的可能的复制[如何做到的的if/else在mustache.js?](http://stackoverflow.com/questions/6027525/how-do-i-accomplish-an- if-else-in-mustache-js) – bjornte 2016-03-09 10:00:14