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

Ability to import external modules #19

Open
embedded-spirit opened this issue Jun 12, 2016 · 3 comments
Open

Ability to import external modules #19

embedded-spirit opened this issue Jun 12, 2016 · 3 comments

Comments

@embedded-spirit
Copy link

embedded-spirit commented Jun 12, 2016

Wouldn't it be nice to have the ability to import external modules?
Possible solution:

<script mode='hoisted'>
import * as R from 'ramda'
import anotherTemplate from './anotherTemplate.js'
</script>
@davidjamesstone
Copy link
Owner

Sorry for the late reply.

Yes I've had the same thought, I like your idea of using a mode attribute on the script tag.

My reservation has been that it doesn't encourage keeping code separate in respective .js and .html files.
The same result can be achieved using this approach and passing in the imported dependencies as arguments or as part of a model.

@alexsad
Copy link
Contributor

alexsad commented Jun 30, 2016

<require from="./another"></require>
<require from="./resource.css!"></require>

@alexsad
Copy link
Contributor

alexsad commented Jul 1, 2016

import first the ".html" (template incremental converted to js by superviewsjs) and the .js with the same name by convention like Aurelia.

<require from="./another"></require>

import styles direct from template.

<require from="./resource.css!"></require> 

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

3 participants