Skip to content

Push data from form to table, table rendered by alpine template #1192

Answered by aidenybai
anjanesh asked this question in 1. Help
Discussion options

You must be logged in to vote

Hey anjanesh, to understand why this isn't working you will need some understanding on how Alpine works. When the content is grabbed, the state is set inside alpine and becomes a separate thing. You will need to directly change the state using alpine __x. Another possible solution is just writing good Alpine code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Table</title>
    <script
      src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js"
      defer
    ></script>
    <script>
      let content = [
        { name: 'Test 1', description: 'Test Description 1' },
        { name: 'Test 2', description: 'Test Description 2' },

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by anjanesh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants