Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend rt-template for in-component usage #155

Open
nippur72 opened this issue Jun 17, 2016 · 0 comments
Open

extend rt-template for in-component usage #155

nippur72 opened this issue Jun 17, 2016 · 0 comments

Comments

@nippur72
Copy link
Contributor

Currently rt-template allows to define a component and to pass it via props to the parent component as a factory function (a function that creates an element).

Now such function is available only to the calling element, and not the current element despite it being defined in its scope.

I propose to extend the syntax allowing the factory function to be used in the same component where rt-template appears.

An example:

<div>
   <rt-template arguments="name" function="greeter">
      <button>Hello {name}!</button>    
   </rt-template>

   {greeter('Bender')}
   {greeter('Fry')}
   {greeter('Leela')}
</div>

In the above example function="greeter" tells to not pass the template to props but instead make it available in the current scope with the name greeter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant