1

I want to display star ratings for values in a REST API. For every product my API contains a parameter called ratings which ranges from 1-5.

I'm only able to find the code for clickable ratings. But I want to show that value in the form of stars from 1-5. Like how we have stars for movie ratings or product ratings.

I found this link but it is for Angular1 Rendering a Star Rating System using angularjs

Please help me with this.Thanks in advance.

Impromptu_Coder
  • 425
  • 3
  • 7
  • 27
  • 1
    Did you try the [solution](https://stackoverflow.com/a/37445400/7088500) from this [post](https://stackoverflow.com/questions/37438098/ionic2-angular2-dynamic-rate-value-with-ion-icon-star?rq=1) ? – skm Jun 05 '17 at 06:23

1 Answers1

0

You may use Angular Bootstrap library. Simply install it with npm command like this: npm install --save @ng-bootstrap/ng-bootstrap Don't forget to import to your module: import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; @NgModule({ ... imports: [NgbModule, ...], ... })

Check the official documentation for the reference: https://ng-bootstrap.github.io/#/components/rating/examples

Max
  • 11
  • 3