在传递的本地模型的html中将if标签与swig进行比较

时间:2014-07-07 20:20:07

标签: html swig-template

我想比较我的item.adminUse,这是" true"或"错误"没有给出正确的输出

HTML

{% for item in data%}
    <tr>
        {%if item.adminUse%}
        <td >{{item.id}}</td>
        <td >{{item.firstName}}</td>
        <td >{{item.adminUse}}</td>
     {%endif%}
    {%endfor %}

脚本

exports.index = function(req, res){
    db('stdnt').find().done(function (err, models) {
        if ( err )
            console.log("Error in Index of Student:"+err);
        else
        console.log(models)
        res.render( 'stdnt/index',{data:models});//, { title: 'CRUD in Node', data:       models });
    });
};

上面是控制器,它呈现该链接并发送该数据&#34;模型&#34;

0 个答案:

没有答案