Home > Mobile >  using Rating in ng select angular
using Rating in ng select angular

Time:12-20

I tried to use p-rating in ng select but when I want to click on Rating the ng select is clicked if I want to just click on Rating but ng select is clicked My problem is that I want to click Rating but after click my dropdown clicked instead of rating my html code

  <ng-select  [items]="Menu" bindLabel="title" bindValue="facode" [notFoundText]="NotFoundText"
        (search)="onSearch($event)" placeholder="جستجو در منو..." (change)="selectMenu($event)">
        <ng-template ng-option-tmp let-item="item" let-index="index">
          <p> {{item.title}} </p>
          <p-rating    stars="1" [cancel]="false"></p-rating>
        </ng-template>
      </ng-select>

Please see the photo

enter image description here

CodePudding user response:

Use event.stopPropagation(); in your change and search method.

CodePudding user response:

You try this link. I am using it and it is ok.

https://ng-bootstrap.github.io/#/components/rating/examples

  • Related