You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
Rating directive that will take care of visualising a star rating bar.
2
2
3
-
It also provides optional attributes: `max` to vary the number of stars, `readonly` to disable user's interaction, `on-hover` to signal when the user's mouse is over a particular star, and `on-leave` to signal when the mouse leaves the control altogether.
3
+
### Settings ###
4
+
5
+
#### `<rating>` ####
6
+
7
+
*`value` <iclass="icon-eye-open"></i>
8
+
:
9
+
The current rate.
10
+
11
+
*`max`
12
+
_(Defaults: 5)_ :
13
+
Changes the number of icons.
14
+
15
+
*`readonly`
16
+
_(Defaults: false)_ :
17
+
Prevent user's interaction.
18
+
19
+
*`on-hover(value)`
20
+
:
21
+
An optional expression called when user's mouse is over a particular icon.
22
+
23
+
*`on-leave()`
24
+
:
25
+
An optional expression called when user's mouse leaves the control altogether.
26
+
27
+
*`state-on`
28
+
_(Defaults: 'icon-star')_ :
29
+
A variable used in default template to specify the class for selected icons.
30
+
31
+
*`state-off`
32
+
_(Defaults: 'icon-star-empty')_ :
33
+
A variable used in default template to specify the class for unselected icons.
34
+
35
+
*`rating-states`
36
+
_(Defaults: null)_ :
37
+
An array of objects defining properties for all icons. In default template, `stateOn` & `stateOff` property is used to specify the icon's class.
<ing-repeat="number in range" ng-mouseenter="enter(number)" ng-click="rate(number)" ng-class="{'icon-star': number <= val, 'icon-star-empty': number > val}"></i>
2
+
<ing-repeat="r in range" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" ng-class="$index < val && r.stateOn || r.stateOff"></i>
0 commit comments