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

Redesign Website #253

Merged
merged 61 commits into from
Aug 9, 2019
Merged

Redesign Website #253

merged 61 commits into from
Aug 9, 2019

Conversation

kbrsh
Copy link
Owner

@kbrsh kbrsh commented Aug 9, 2019

Redesigned website for v1 beta 3! 🎉

@kbrsh kbrsh merged commit 4fe0773 into gh-pages Aug 9, 2019
@kbrsh kbrsh deleted the new-website branch August 9, 2019 00:36
```

<a href="/play#const%20Todos%20%3D%20(%7B%20data%20%7D)%20%3D%3E%20(%0A%09%3Cfor%3D%7Btodo%7D%20of%3D%7Bdata.todos%7D%20name%3D%22ul%22%3E%0A%09%09%3Cli%3E%7Btodo%7D%3C%2Fli%3E%0A%09%3C%2Ffor%3E%0A)%3B%0A%0AMoon.use(%7B%0A%09data%3A%20Moon.data.driver(%7B%0A%09%09todo%3A%20%22%22%2C%0A%09%09todos%3A%20%5B%0A%09%09%09%22Learn%20Moon%22%2C%0A%09%09%09%22Take%20a%20nap%22%2C%0A%09%09%09%22Go%20Shopping%22%0A%09%09%5D%0A%09%7D)%2C%0A%09view%3A%20Moon.view.driver(%22%23root%22)%0A%7D)%3B%0A%0AMoon.run((%7B%20data%20%7D)%20%3D%3E%20(%7B%0A%09view%3A%20(%3CTodos%20data%3D%7Bdata%7D%2F%3E)%0A%7D))%3B">Try it!</a>

First of all, the `Todo` function returns a view using the Moon view language. It uses an HTML-like syntax for creating views based on components. In this case, `<for>` is a component. You'll notice how we pass `name="ul"`, which tells the `<for>` component to wrap the loop in a `ul` tag. Inside the loop, we render an `li` element. The curly braces `{}` are for interpolating JavaScript expressions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be Todos right?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I'll fix it asap :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants