Open jshuadvd opened 5 years ago
const App = { $cell: true, ... }
is not in the global scope (since modules have their own scope). Use window.App = { $cell: true, ... }
. Here is an example:
<html lang='en'>
<head>
<meta charset='UTF-8'>
<script src='https://www.celljs.org/cell.js'></script>
<script type='module' src='/js/app.js'></script>
</head>
</html>
'/js/app.js'
import { hello } from './hello.js'
import { world } from './world.js'
window.app = {
$cell: true,
$components: [ hello, world ]
}
'/js/hello.js'
export const hello = { $text: 'Hello' }
'/js/world.js'
export const world = { $text: 'World' }
Hi! Not sure if this is just something I am not doing correctly. I have tried everything to set up my project like a modular application. Rather than adding everything into my app via a
<script>
tag in myIndex.html
file, I have a single.js
file( index.js )
that imports everything in as individual components. Below is a simplified version of the code:I have tried everything I can possibly think of to call
App
in myindex.html
file, but no solutions work for actually rendering it to the DOM. If I add all of this in the playground or directly intoindex.html
I can render it, but no luck with renderingApp
fromindex.js
Can you provide any help?