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

DS.attr / DS.Transform

$
0
0

@chautelly wrote:

I'm attempting to write some DS.Transform classes, but I'm confused about the application of DS.attr. Values do not seem to get converted to boolean or number when using DS.attr('boolean'), DS.attr('number').

export default DS.Model.extend({
  foo: DS.attr('boolean')
});

...

 var bar = this.store.createRecord('foomodel');
 bar.set('foo', 'hello');

Calling .get or checking using the Ember inspector, the value of foo is "hello". No boolean conversion seems to be happening.

 Ember      : 2.3.0-beta.1
 Ember Data : v2.3.0-beta.1

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 4827

Trending Articles