samedi 30 avril 2016

Create a computed bool using relationship field Ember

I'm trying figure out how my computed property identify if my relationship was set.

author: BelongsTo('author'),
hasAuthor: Ember.computed.bool('author')

I need change my css based if has a author.


//---------- my-component.js
export default Ember.Component.extend({
  classNameBindings: ['hasAuthor'],
  hasAuthor = Ember.computed( () => get('post').get('hasAuthor') )
});




Aucun commentaire:

Enregistrer un commentaire