Help Me Solve an Alpine.js Mystery

Yesterday I wrote up my experience in building a simple CRUD interface using Alpine.js, and in doing so, ran into an interesting issue. While it would be best to read the entire previous article, let me try to break down the issue… or at least as how I saw it. My Alpine app had a variable, cats, that was an array of objects. I looped over them and displayed them in a simple table: <template x-for="cat in cats"> Notice I’m using a variable, cat, to represent each element of the array. Here’s one example of using it: <td x-text="cat.name"></td> The application also made use of a cat variable. This was intended to be used in the edit form.... more →
Posted in: JavaScript