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

Ripple + jade #43

Closed
vmariano opened this issue Oct 3, 2014 · 2 comments
Closed

Ripple + jade #43

vmariano opened this issue Oct 3, 2014 · 2 comments

Comments

@vmariano
Copy link

vmariano commented Oct 3, 2014

I come from a project who use jade as template engine. Is possible combine both jade template with a ripple template?

With jade, I can do:

jadeTemplate({item: item});

For the moment I do something like

var Template = ripple(jadeTemplate());

I need to call it, to get the template as string.

Can I do in other way?

@anthonyshort
Copy link
Contributor

You could compile a jade template to a string or HTML and pass that into ripple as the template to parse, like you're doing.

Do you want to use the view data to render the jade template to a string? If so, you could do something like,

function jade(options) {
  return function(View) {
    View.on('created', function(view){
      view.template = jadeTemplate(view);
    });
  }
}

And then:

var Template = ripple(jadeString)
  .use(jade());

Depends what you're trying to do though

@vmariano
Copy link
Author

vmariano commented Oct 5, 2014

Thanks for your help!

I'm really new with ripple and i'm in the middle of migration from component/dom to ripple. :)

@vmariano vmariano closed this as completed Oct 5, 2014
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

2 participants