KOSASIH / pi-nexus-autonomous-banking-network

Use $document instead of document JS-0555
Anti-pattern
Minor
2 months ago4 months old
You should use the $document service instead of the default document object
28  if (vote < 0) {
29    document.getElementById("vote").setCustomValidity("Please enter a positive number.");
30  } else {
31    document.getElementById("vote").setCustomValidity("");32  }
33});
You should use the $document service instead of the default document object
26document.getElementById("vote").addEventListener("input", () => {
27  const vote = parseFloat(document.getElementById("vote").value);
28  if (vote < 0) {
29    document.getElementById("vote").setCustomValidity("Please enter a positive number.");30  } else {
31    document.getElementById("vote").setCustomValidity("");
32  }
You should use the $document service instead of the default document object
24});
25
26document.getElementById("vote").addEventListener("input", () => {
27  const vote = parseFloat(document.getElementById("vote").value);28  if (vote < 0) {
29    document.getElementById("vote").setCustomValidity("Please enter a positive number.");
30  } else {
You should use the $document service instead of the default document object
23  document.getElementById("vote").value = "";
24});
25
26document.getElementById("vote").addEventListener("input", () => {27  const vote = parseFloat(document.getElementById("vote").value);
28  if (vote < 0) {
29    document.getElementById("vote").setCustomValidity("Please enter a positive number.");
You should use the $document service instead of the default document object
20    return;
21  }
22  castVote(vote);
23  document.getElementById("vote").value = "";24});
25
26document.getElementById("vote").addEventListener("input", () => {