Is it possible to load the innerText multiple HTML files into an array? I creating a simple search engine for a project and can only make it work in a very ugly way:
In the view repeating over an array that contains the full paths to the .html files that I want to be able to search.
Results.html:
<div repeat.for="helpfile of fullResults"> <div show.bind="false" id="url${$index}" as-element="compose" view="${helpfile.url}"></div>
After the DOM is loaded I can then search the document for unique Id’s and save the innertext of the files into the array.
Results.ts:
this.fullResults.forEach((x, index) => { x.searchtext = document.getElementById("url" + index).innerText.toLowerCase(); });
Does Aurelia have a loader/class/method etc. to do this more nicely without going back and forth between the View and View-Model? If someone has a better solution, hopefully you can point me in the right direction
Thanks!