angularjsbuttonratingng-switch

angular button rating with collapse


The objective is to combine the rating provided here in example: http://angular-ui.github.io/bootstrap/#/rating w/ the collapse here: http://angular-ui.github.io/bootstrap/#/collapse

Is it possible to make use the rating implementation and have each star binded to a unique collapse and message.(i.e. clicking 1 star collapses a message saying "you selected "{{rating}}" star!"

I was trying to use ng-switch at first, but any suggestions would be appreciated.


Solution

  • Does something like this suit your needs ?

    http://plnkr.co/edit/cGxCRDWb3OX5RzJjSwUV?p=preview

    I just made the collapse condition equal to rating ng-model so the message only shows when there is a rating selected.