From d5a757d46dfba96c9b8587aa460432b5ac9fbca4 Mon Sep 17 00:00:00 2001 From: zach_lysobey Date: Sun, 7 Feb 2016 13:56:28 -0500 Subject: [PATCH] fix(rating): change to read-only Closes #5371 Closes #5435 BREAKING CHANGE: Attribute supported has been changed to `read-only` from `readonly` --- src/rating/docs/demo.html | 2 +- src/rating/docs/readme.md | 2 +- src/rating/rating.js | 2 +- src/rating/test/rating.spec.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rating/docs/demo.html b/src/rating/docs/demo.html index 1ad69f7a2e..44f4100413 100644 --- a/src/rating/docs/demo.html +++ b/src/rating/docs/demo.html @@ -1,6 +1,6 @@

Default

- + {{percent}}%
Rate: {{rate}} - Readonly is: {{isReadonly}} - Hovering over: {{overStar || "none"}}
diff --git a/src/rating/docs/readme.md b/src/rating/docs/readme.md index 9b0cd00045..471e8df359 100644 --- a/src/rating/docs/readme.md +++ b/src/rating/docs/readme.md @@ -26,7 +26,7 @@ Rating directive that will take care of visualising a star rating bar. _(Default: `null`)_ - An array of objects defining properties for all icons. In default template, `stateOn` & `stateOff` property is used to specify the icon's class. -* `readonly` +* `read-only` $ _(Default: `false`)_ - diff --git a/src/rating/rating.js b/src/rating/rating.js index d6ae1d7f73..6ccc54e2a6 100644 --- a/src/rating/rating.js +++ b/src/rating/rating.js @@ -85,7 +85,7 @@ angular.module('ui.bootstrap.rating', []) return { require: ['uibRating', 'ngModel'], scope: { - readonly: '=?', + readonly: '=?readOnly', onHover: '&', onLeave: '&' }, diff --git a/src/rating/test/rating.spec.js b/src/rating/test/rating.spec.js index 4e176fde9d..f5614647f7 100644 --- a/src/rating/test/rating.spec.js +++ b/src/rating/test/rating.spec.js @@ -125,9 +125,9 @@ describe('rating directive', function() { expect(element.attr('aria-valuemax')).toBe('15'); }); - it('handles readonly attribute', function() { + it('handles read-only attribute', function() { $rootScope.isReadonly = true; - element = $compile('')($rootScope); + element = $compile('')($rootScope); $rootScope.$digest(); expect(getState()).toEqual([true, true, true, false, false]);