vendredi 30 décembre 2016

Show boolean values in Handlebars

Trying to learn Ember JS, and I am a complete beginner.

I have an Ember JS application where a model has a boolean value. When I show this value in Handlebars, I do it like this:

YesNo

What I am not sure of is if this is the correct way to do it? Should I create a helper? Is there some other "best practice" way of doing this?

The model looks like this:

import DS from 'ember-data';
export default DS.Model.extend({
    id: DS.attr('integer'),
    name: DS.attr('string'),
    email: DS.attr('string'),
    location: DS.attr('string'),
    active: DS.attr('boolean'),
    administrator: DS.attr('boolean')
});

I am thankful for all the pointers I can get :)




Aucun commentaire:

Enregistrer un commentaire