Ah, I see. I have to prefix the custom element with data-. I’ve never seen these html validations being enforced so it didn’t even cross my mind.
The div will also have a click event, and I’ll use the pagenumber to do some processing. I know I could just attach the pagenumber to the div id or something along these lines, but creating a dedicated attribute just seemed more straightforward.
Creating a custom attribute with aurelia just seemed overkill, although it’s probably the more correct way. I’ll look into it.
Thanks for the help
In your click binding you could just pass the value along in the function call:
<div click.trigger="someFunc(page.num)">
(if you’re at all concerned about accessibility you should choose to use a link or a button for anything that has a click event, that will make the element tabbable and “clickable” out of the box also for keyboard users)