angular-rating

3.0.3 • Public • Published

Angular Rating

is a module to help you create a rating with some cusomizable options

Rating Example

Current Version

3.0.3

Installation

bower install angular-rating --save

OR

npm install angular-rating --save

Requirements

Usage

Setup

Just include the js file to your html

<script src="/path/to/angular-rating.js"></script>

Then, include the module in your code:

angular.module('myModule', ['angular-rating'];

Directive

This is a component, so at its most basic:

<rating value="foo" max="5"></rating>

This will render the rating contained in foo with maximum 5 stars, and 5 is the default if you don't provide max attribute.

foo should be an Integar:

foo = 1;
foo = 3;
foo = 4;

Attributes

  • value is the only required attribute that should contain Integar as I mentioned above.
  • max is optional and this is the whole number of stars you want to show at a time.
  • size is optional, this option is to provide the size of stars as you want to view them and also provide its unit as well (20px is the default in case it's not provided), just like:
    <rating value="foo" size="30px"></rating>
    <rating value="foo" size="10em"></rating>
  • color is optional, this is the color of the filled stars, so you can choose a color of your choice if not it will be #F3D82C as default value, the color can be a litteral color or HEX color prefixed by #.
    <rating value="foo" color="red"></rating>
    <rating value="foo" color="#333"></rating>
  • interactive is optional, by default it's true, that means you can change the rating but if you assign it to false the rating will be disabled.

License

MIT

Authors

  • Medhat Dawoud (@med7atdawoud)
  • Peter Sobhy

Package Sidebar

Install

npm i angular-rating

Weekly Downloads

14

Version

3.0.3

License

MIT

Last publish

Collaborators

  • medhatdawoud