Created
August 6, 2019 03:35
-
-
Save leenasn/9525dc0ab96107e9988765a58f2eab9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller } from "stimulus" | |
export default class extends Controller { | |
static targets = [ "source", "members" ] | |
search(){ | |
var searchString = this.sourceTarget.value | |
fetch(this.data.get("url")+"?query="+searchString) | |
.then(response => response.text()) | |
.then(html => { | |
this.membersTarget.innerHTML = html | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment