Comments (4)
Thanks for reporting this. Iām close to rolling out a fix, shooting for a release at the end of this week.
from alpine-ajax.
Ah, you have a sneaky syntax error in the first code snippet, x-target
is a directive so you have to drop the :
prefix (just like x-text), this should work:
<template x-for="(note, index) in filenotes" :key="index">
<div>
<div :id="'note'+index"><p x-text="note.filenotes"></p></div>
<div><a :href="'filenotes-edit/'+info.profile.id" x-target="'note'+index">edit</a></div>
</div>
</template>
This won't fix everything yet, there's still an issue with dynamically evaluating x-target
, but I'm working on that fix right now and the code above should work on the next release.
from alpine-ajax.
You can x-target:dynamic
in v0.6.0 now:
<template x-for="(note, index) in filenotes" :key="index">
<div>
<div :id="'note'+index"><p x-text="note.filenotes"></p></div>
<div><a :href="'filenotes-edit/'+info.profile.id" x-target:dynamic="'note'+index">edit</a></div>
</div>
</template>
from alpine-ajax.
Awesome! Thanks @imacrayon
from alpine-ajax.
Related Issues (20)
- Add support for `autofocus`
- `MissingIdError` error thrown when using `x-target.replace` without an ID HOT 2
- Calling $ajax from code outside of Alpine.js HOT 5
- Use ajax:success to preload assets (js) HOT 3
- Could not find a declaration file for module '@imacrayon/alpine-ajax' HOT 3
- Any way to make incoming html replace the innerHTML of target instead of the whole target? HOT 2
- Uncaught (in promise) Missing Target: #[object HTMLButtonElement] was not found in the current document. HOT 5
- SSE and websockets support HOT 3
- Using x-morph, new Alpine components don't initialize HOT 2
- Apply different merge strategy per target HOT 4
- Polling support? HOT 2
- Filterable content + infinite scroll: how to set x-merge attribute HOT 3
- v.0.6.0 broke the usual x-target behavior HOT 8
- x-target response code modifiers HOT 2
- Question: Fetch and headers HOT 2
- Global event listeners HOT 4
- x-sync deletes div if no matching id in response HOT 1
- Redirect on successful form submission HOT 1
- Website examples are currently not working HOT 2
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 alpine-ajax.