angular-rating-yo

WebJar for angular-rating-yo

License

License

MIT
Categories

Categories

Github Development Tools Version Controls Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

github-com-sagarrabadiya-angular-rateyo
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

angular-rating-yo
WebJar for angular-rating-yo
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sagarrabadiya/angular-rateyo

Download github-com-sagarrabadiya-angular-rateyo

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/github-com-sagarrabadiya-angular-rateyo/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>github-com-sagarrabadiya-angular-rateyo</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-sagarrabadiya-angular-rateyo/
implementation 'org.webjars.bower:github-com-sagarrabadiya-angular-rateyo:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.bower/github-com-sagarrabadiya-angular-rateyo/
implementation ("org.webjars.bower:github-com-sagarrabadiya-angular-rateyo:1.0.0")
'org.webjars.bower:github-com-sagarrabadiya-angular-rateyo:jar:1.0.0'
<dependency org="org.webjars.bower" name="github-com-sagarrabadiya-angular-rateyo" rev="1.0.0">
  <artifact name="github-com-sagarrabadiya-angular-rateyo" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='github-com-sagarrabadiya-angular-rateyo', version='1.0.0')
)
libraryDependencies += "org.webjars.bower" % "github-com-sagarrabadiya-angular-rateyo" % "1.0.0"
[org.webjars.bower/github-com-sagarrabadiya-angular-rateyo "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower » jquery-rateyo jar [2.0.1,2.1)
org.webjars.bower : angular jar [1.4.1,1.5)

Project Modules

There are no modules declared in this project.

angular-rating-yo

Description

This directive allows you to enhance your rating feature in the application with behaviour from the jquery.rateyo library.

Requirements

Setup

  1. Install Grunt and Bower $ npm install -g grunt-cli bower
  2. Install development dependencies $ npm install
  3. Install components $ bower install
  4. ???
  5. Profit!

Usage

We use bower for dependency management. Install angular-rating-yo into your project by running the command

$ bower install angular-rating-yo

If you use a bower.json file in your project, you can have Bower save ui-select2 as a dependency by passing the --save flag with the above command.

This will copy the angular-rating-yo files into your bower_components folder, along with its dependencies. Load the script files in your application:

<link rel="stylesheet" href="bower_components/jquery-rateyo/src/jquery.rateyo.css">
<script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
<script type="text/javascript" src="bower_components/jquery-rateyo/src/jquery.rateyo.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/angular-rating-yo/src/angular-rating-yo.js"></script>

(Note that jquery must be loaded before angular so that it doesn't use jqLite internally)

Add the rateYo module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['rateYo']);

Apply the directive to your rating elements:

<rate-yo on-set="set" on-change="change" ng-model="rating" read-only="options.readOnly" options="options"></rate-yo>

Options

All the rateYo options can be passed through the directive. You can read more about the supported list of options and what they do on the rateYo Documentation Page

myAppModule.controller('MyController', function($scope) {
     $scope.options = {
            ratedFill: '#f00',
            readOnly: false,
            halfStar: false,
            fullStar: false
        };
});
<rate-yo on-set="set" on-change="change" ng-model="rating" read-only="options.readOnly" options="options"></rate-yo>

Some times it may make sense to specify the options in the template file.

<rate-yo on-set="set" on-change="change" ng-model="rating" read-only="options.readOnly" options="{ratedFill: '#f00'}"></rate-yo>

Versions

Version
1.0.0