mercredi 26 octobre 2016

Ember opposite of positionalParams

In an Ember Component it is possible to define a positionalParams property so that parameters passed as positional params become available as properties. E.g:

let MyComponent = Ember.Component.extend;
MyComponent.reopenClass({
  positionalParams: ['name', 'age']
});

when it is invoked: the property name has the value John and de property age has the value 38.

I would like to have the opposite behavior but I cannot find whether this is possible. The behavior I'm looking for is like following:

Instead of passing a number of positional params () I would like to pass an array property () because it can be of a dynamic size.

I'm not only looking for this behavior at components, but also helpers: should become . The helper should get the same params-array as first argument in both cases.




Aucun commentaire:

Enregistrer un commentaire