28 Jun 20172 minutes to read

In data binding concept of Rating control, need to set the value property using two way binding that is you need to assign the rating value using scope variable.

The following example depicts the way to bind data to the Rating control.

Add the following code to render Rating with data binding.

  • HTML
  • <body ng-controller="RatingCtrl">
                <div id="control">
                    <input id="apiRating" type="text" class="rating" ej-rating e-value="ratingValue">
                <div id="binding">
                    <input type="text" class="input ejinputtext" name="rating" value="" ng-model="ratingValue" />
  • angular.module('ratingApp', ['ejangular'])
        .controller('RatingCtrl', function ($scope) {
            $scope.ratingValue = 3;
  • CSS
  • <style type="text/css" class="cssStyles">
            #binding {
                margin-left: 150px;
            .control {
                margin-top: 10px;
            .input {
                height: 27px;
                text-indent: 10px;
                width: 81%;

    The following screenshot displays the output of Rating with data binding support.