https://github.com/fraserxu/ionic-rating
An angularjs directive that take care of visualising a star rating bar
https://github.com/fraserxu/ionic-rating
Last synced: about 1 year ago
JSON representation
An angularjs directive that take care of visualising a star rating bar
- Host: GitHub
- URL: https://github.com/fraserxu/ionic-rating
- Owner: fraserxu
- License: mit
- Created: 2014-05-13T07:19:03.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-07-03T21:26:57.000Z (almost 8 years ago)
- Last Synced: 2025-02-26T00:07:09.451Z (over 1 year ago)
- Language: CoffeeScript
- Size: 21.5 KB
- Stars: 142
- Watchers: 8
- Forks: 56
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ionic - fraserxu/ionic-rating
README
ionic-rating
============
An angularjs directive that take care of visualising a star rating bar, build
for ionic.

Also able to print half star (display only) :

#### Why?
`angular-ui` has the same [rating](http://angular-ui.github.io/bootstrap/#/rating) directive,
but it is build on top of bootstrap. This repo just reuse most of the js code, but build for
the [ionic](http://ionicframework.com/) framework.
#### How to use?
Install with bower:
```
$ bower install ionic-rating
```
In your index.html
```HTML
```
In you template:
```HTML
```
In you controller:
```JavaScript
// first inject it into your app
angular.module('youApp', ['ionic.rating'])
.controller('yourCtrl', function($scope) {
// set the rate and max variables
$scope.rating = {};
$scope.rating.rate = 3;
$scope.rating.max = 5;
});
```
For strict-di, you can use
```
.controller('RatingController', [ '$scope', '$attrs', 'ratingConfig', function($scope, $attrs, ratingConfig) ]
```
If you want to make it read only
> added readonly="readOnly" to rating directive, and $scope.readOnly = true; to the controller.
**Note:** You may also need to include the style file. But I suggest you just copy it to your
project.
#### Build
```
$ npm i
$ make all
```
#### License
MIT