Keeps what is yielded for later use in a component


#1

Hi,

I’m contributing to https://github.com/piceaTech/ember-rapid-forms and I want to do something like this :

{{#em-custom-input label="example"}}
   Something
{{/em-custom-input}}

This will produce “Something” with a label. If I simply use yield in templates, I have to change this template and this other one and probably some others. This is a big change and I want to know if there is a way to keep the value that have to be yielded in a variable in the component for a later use?

Is it possible?


#2

I’m not sure I follow, surely if you want to access it as a variable/property then you would just pass it to the component as a named property?

I guess you could so something hacky like read the value using jQuery in the didInsertElement hook if you absolutely have to use yield.