Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can use `<template>` for that purpose and keep your separation of concerns okay.


As a non web dev I had to look this up and yeah, this looks like a very sane and clean way to separate concerns and get proper handling from IDEs:

https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...


Indeed, the Web Components APIs don't demand that you put the HTML and JS together. You can use it and structure it to your own likes.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: