1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 static values = { 5 title: String, 6 image: String, 7 tags: Array, 8 ingredients: Array, 9 instructions: String 10 } 11 12 open(event) { 13 event.preventDefault() 14 event.stopPropagation() 15 16 const recipesElement = document.querySelector('[data-app="recipes"]') 17 if (!recipesElement) { 18 console.warn('Recipes app element not found') 19 return 20 } 21 22 const recipesController = this.application.getControllerForElementAndIdentifier( 23 recipesElement, 24 'recipes' 25 ) 26 27 if (recipesController) { 28 recipesController.open({ 29 title: this.titleValue, 30 image: this.imageValue, 31 tags: this.tagsValue, 32 ingredients: this.ingredientsValue, 33 instructions: this.instructionsValue 34 }) 35 } else { 36 console.warn('Recipes controller not found') 37 } 38 } 39} 40
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.