AmadeusITGroup / AgnosUI

Multiframework Frontend Component Libraries, including Headless and Bootstrap
https://www.agnosui.dev
MIT License
57 stars 13 forks source link

Angular widgets apis refactor #47

Closed quentinderoubaix closed 1 year ago

quentinderoubaix commented 1 year ago

Context Following our discussion regarding the angular widgets apis, we have decided that angular widgets should obey the following rules:

Example of change For the rating default, this would mean going from:

<au-rating [(rating)]="rating" (hover)="hovered = $event" (leave)="left = $event" ariaLabel="rating" />

to

<div [(au-rating)]="rating" (au-hover)="hovered = $event" (au-leave)="left = $event" au-aria-label="rating"></div>
divdavem commented 1 year ago

As discussed today with @quentinderoubaix, maybe we should rather finally use camelCase:

<div [(auRating)]="rating" (auHover)="hovered = $event" (auLeave)="left = $event" auAriaLabel="rating"></div>

That's what people are used to for attributes in Angular, and also otherwise, it is strange to have a mix of kebab-case and camelCase for bindings (i.e. (au-ratingChange)=... which is mandatory if we want to support [(au-rating)]="rating").