mercredi 20 mai 2015

Can I define default values for attributes in ember components when using angle-brackets syntax (1.13)?

I'm testing ember-1.13.0-beta.1 on on an application and can't find a way to provide default values for attributes. I was previously using properties with default values:

export default Ember.Component.extend({
  myAttribute: 'default-value',
});

{{my-component myAttribute=otherValue}}

I tried this:

export default Ember.Component.extend({
  attrs:{
    myAttribute: 'default-value',
  },
});

<my-component myAttribute={{otherValue}} />

but it doesn't work. Did I miss something?




Aucun commentaire:

Enregistrer un commentaire