Skip to content

Pass parameters to imported partials #184

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

Closed
entozoon opened this issue Sep 28, 2018 · 10 comments
Closed

Pass parameters to imported partials #184

entozoon opened this issue Sep 28, 2018 · 10 comments

Comments

@entozoon
Copy link

Not sure if feature request, or currently possible (#120 ?), but it'd be mad useful.

Using 1.0.0-alpha.0

parent.html

<import src="./component.html" foo="bar"></import>

component.html

<div> ${foo} </div>
@alexander-akait
Copy link
Member

@entozoon
Copy link
Author

Really? I mean, I don't want to use polymer or JS at all ideally. My use case is building a set of html templates rather than an app. (But later built into one)

@orangecoloured
Copy link

orangecoloured commented Oct 29, 2018

Would be great to see this feature implemented. I'm migrating a project from gulp to webpack and there's the gulp-file-include plugin that can inject params into partials. Nothing fancy, just passing strings.

@alexander-akait
Copy link
Member

HTML doesn't support variable you need loader for templates depending what template language you are use

@orangecoloured
Copy link

@evilebottnawi I'm using html language. I have a number of html files that should share the same meta tags, but should have different titles and sometimes description.

@alexander-akait
Copy link
Member

@orangecoloured Feel free to send a PR

@entozoon
Copy link
Author

A direct replacement with https://github.com/pcardune/handlebars-loader/ did the trick for my use-case, in the meantime.

@orangecoloured
Copy link

I ended up using ejs.

@denis-migdal
Copy link

I am flooding a little, but I created a loader that might do the trick:
https://github.com/denis-migdal/prehtml-loader

@alexander-akait
Copy link
Member

The import feature was removed from official html specifications so we don't want to support it, next major release will be without import support , feel free to leave feedback,

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

4 participants