The code you are seeing technically works. But VS Code, shows me an underline under the replaceAll function. I would like to know why, and what I could do to avoid this happening again.
renderTemplateText(str) {
var parser = new DOMParser();
var doc = parser.parseFromString(str, "text/html");
var xRepeat = doc.querySelectorAll('[x-repeat]');
var divarray = doc.querySelectorAll('[is^="x-"]');
var divarraylength = divarray.length;
for (var i = 0; i < divarraylength; i++) {
var dataAttribute = divarray[i].getAttribute('data-link');
console.log(divarray[i]);
if (dataAttribute !== null) {
dataAttribute = dataAttribute.replaceAll("props", this.propsname);
}
console.log(dataAttribute );
}
}
>Solution :
Youcan honestly just ignore this. Its just an "VS-Code thing".
I am assuming, it works? I made the not given value props myself, and it worked fine.