Comments (5)
Hey you forgot to define viewTodos
const viewTodos = ({ data }) =>
<ul children=(data.todos.map(todo =>
<li>{todo}</li>
))/>;
Also you have to say witch elements do you want to use with
const { ul, li } = Moon.view.m
But for the next time rtfm
from moon.
Yes, but I still get a syntax error with the full code (or your additions).
But for the next time rtfm
I'm trying
Thanks for your help.
from moon.
In Moon, self closing tags must be specified with a closing />
. Also, arrow functions need parentheses around the return value if it's an object (this is a JS syntax thing, not moon).
Try this:
Moon.use({
data: Moon.data.driver,
view: Moon.view.driver("#root")
});
Moon.run(() => ({
data: [],
view: <viewTodos data=[]/>
}));
from moon.
It probably was that closing tag, I didn't see that. It was code copied from a example in a blog. When I replaced it with the similar code on the moon website it worked. I misread the browser error message as an error with the library ;-) Live and learn.
I'm sorry to have wasted your time.
from moon.
@nottledim Don't worry about it! It took me a while to see the error too, the object return syntax always gets me. As for Moon, better syntax errors are coming in the next beta. Hope you enjoyed trying it out! :)
from moon.
Related Issues (20)
- linking of mvl external file HOT 8
- Import libraries to use in components HOT 10
- Update Example HOT 5
- onCreate() doesn't have access to "this" HOT 7
- Q: Pass data to component? HOT 2
- Moon v1 Roadmap HOT 33
- awesome build-less moon (+lazy load components?) HOT 5
- is beta 3 production ready? HOT 2
- Common Editor Support for Syntax HOT 5
- Some attributes have to be set by attribute and not by DOM HOT 3
- Moon compiler does not apply DOM event listeners or attributes to created element by for HOT 4
- ubuntu 16 fasnetmoon HOT 2
- use moon in browser HOT 8
- How to apply DRY principles in example code HOT 3
- Any thoughts on hydrating data with SSR? HOT 3
- Fix environment variables on Windows HOT 1
- 没问题,只是开一下而已! HOT 2
- How to reset recursive time driver HOT 3
- Is this project active or dead? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moon.