amp-bind: TODO list use case
See original GitHub issue@sebastianbenz suggested amp-bind support a use case like ToDoMVC. One way to accomplish this is to allow amp-mustache
to template using amp-bind
state.
This would be a cool addition, though I wonder if allowing Bind to add/remove DOM elements is too powerful. @ericlindley-g mentions that this is an app-like use case that hasn’t been prioritized yet.
/cc @cramforce
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top Results From Across the Web
amp-bind brings flexible interactivity to AMP pages
Sorting & filtering with server-side data is now possible through amp-list[src] binding. It uses amp-bind to coordinate events and actions ...
Read more >amp-script: Interop with [on] actions · Issue #24763 - GitHub
Use cases : trigger an action in the backend that's not possible via amp-form; add a todo item to a todo list (this...
Read more >AMP-EMAIL: Iterate list of items from amp-state - Stack Overflow
It's not possible to iterate an AMP state in that way. You have two options: Option 1. Use mustache templates instead.
Read more >4 tricks for developing with the AMP framework
Now all that remains is to use that formLightboxTitle property inside our lightbox. To do this, the amp-bind component allows us to use...
Read more >Support for Google AMP for Email in SparkPost Coming Soon
AMP for Email Use Cases · Verifying an email address · Acknowledging a security alert · Submitting an RSVP to an event ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I implemented a todo app with just
amp-bind
to show that it is possible. The only caveat is that the max number of todos is determined by the html structure and can not be dynamically increased. See yourselfI’d love to see this happen, especially for the commenting use case. Seems like it’d be really powerful to be able to update a small piece of state after a form submission, and then use that local state to re-render the template without requiring a re-fetch of the whole data set.