The Rating component provides a star-based rating with the ability to select and cancel. The basic declaration of the component would be as follows:
<p-rating name="basic" [(ngModel)]="angular" ></p-rating>
Here, the rating-bounded value should be a number type. The default visual of an Angular rating will look as shown in the following screenshot:
The star attribute helps to provide the number of stars in the rating. The default value of star is 5.
The behavior of selecting and canceling the rating can be more interactive, and you can get notified with the help of onRate and onCancel callbacks. In the preceding snapshot, the rating value can be cleared with the cancel icon on the left-hand side. This is because, by default, the cancel attribute will be enabled. If the attribute is disabled then there is no chance of canceling the rating once it is selected. By disabling the cancel attribute, the rating snapshot will display without the icon...