-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Conversation
@lepit31 - The existing tests fail and we'd also like to see some new tests for this please :-). |
Fix the compilation bug This is my first git commit , sorry for the annoyance. |
No problem man. Appreciate the input. Everybody has got to start somewhere. |
@@ -16,6 +16,10 @@ Rating directive that will take care of visualising a star rating bar. | |||
_(Defaults: false)_ : | |||
Prevent user's interaction. | |||
|
|||
* `titles` | |||
_(Defaults: ["bad","poor","regular","good","gorgeous"])_ : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add spaces after each comma
it('should return the custom title for each star', function() { | ||
element = $compile('<rating ng-model="rate" titles="[44,45,46]"></rating>')($rootScope); | ||
$rootScope.$digest(); | ||
expect(getTitles()).toEqual(['44','45','46','4','5']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spacing
I spent some time refactoring the work & cleaning up the history just now - I changed the default values to |
Add an attribute "titles" to set a custom title for each star by it position on array.
if the index of the star is greater than the titles array length return the index +1 of the star
Add a default value ["bad","poor","regular","good","gorgeous"]