jeudi 14 juillet 2016

Setting HTML tag's class based on mongo result in meteor

I'm building a list-group that contains exceptions and warnings thrown out by a back-end device. The list-group reads off a collection with a field called 'type'. This type field can contain warnings or errors. Based on warnings / errors, how do I set list-group-item-danger / list-group-item-warning in meteor?

Mongo Collection looks like this:

{ type:"red", timestamp: new Date(), message:"something happened 3"}

My list-group-item looks like this:

<a href="#" class="list-group-item clearfix">
        <i class="fa fa-comment fa-fw"></i> 
        <div class="pull-right text-muted small"><em></em>
        </div>
    </a>

How do I incorporate a list-group-item list-group-item-dangerbased ontype = red` returned by mongo?

Aucun commentaire:

Enregistrer un commentaire