Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4828

Ember-data store my attr('number') as a string!? Why?

$
0
0

@Myrdhin wrote:

Hello,

I define this model:

import DS from 'ember-data';

export default DS.Model.extend({
    nb: DS.attr('number')
});

And, in my template, i use:

{{input name="mynb" value=(mut model.nb)}}

But when i use nb in my controller after changed its value with this input, nb become a string?! I thought ember-data cast it to a number before store it (and not only when i send my modified model to my backend server). No?

Will we have to create an action in the controller or a Computed Property in the model to perform this type casting :disappointed_relieved:?

Thanks for your help,

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles