The data-router-ignore is introduced to play nice with another Aurelia feature: automatic data attribute creation.
<a href="/some/link" data-router-ignore.bind="condition || null">Conditional Skip Hijacking</a>
Here Aurelia will dynamically add/remove attribute data-router-ignore
when condition changes. Note || null
is necessary because Aurelia only removes the data attribute when the bound value becomes null
or undefined
, it doesn't remove the data attribute when bound value is 0
or ""
or even false.
In comparison, <a href="/some/link" router-ignore.bind="condition || null">Does not work</a>
does NOT add/remove
attribute router-ignore
. Aurelia only does that for data-
or aria-
attributes.