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: {{my-component "John" 38}}
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 ({{my-comp param1 param2}}
) I would like to pass an array property ({{my-comp positionalArguments=myArray}}
) because it can be of a dynamic size.
I'm not only looking for this behavior at components, but also helpers: {{ concat firstName " " lastName }}
should become {{ concat positionalArguments=myArray }}
. The helper should get the same params-array as first argument in both cases.
MyComponent
is usingreopenClass
method for definingpositionalParams
. so this is specific to classMyComponent
. I would say defining positionalParams dynamically its not possible. – Ember Freak