Files
torsearch/assets/controllers/movie_results_controller.js

21 lines
547 B
JavaScript

import { Controller } from '@hotwired/stimulus';
/*
* The following line makes this controller "lazy": it won't be downloaded until needed
* See https://github.com/symfony/stimulus-bridge#lazy-controllers
*/
/* stimulusFetch: 'lazy' */
export default class extends Controller {
static values = {
imdbId: String
};
connect() {
fetch(`/torrentio/movies/${this.imdbIdValue}`)
.then(res => res.text())
.then(response => {
this.element.innerHTML = response;
});
}
}