title: AngularJS + jQuery Raty - directive
body: <p>I've create a directive on <code>AngularJS</code> based on <code>jQuery Raty</code> plugin.</p>
  
  <pre><code>patclin.directive("ngRaty", function() {
  return {
      restrict: 'A',
      link: function(scope, elem, attrs) {
  
              $(elem).raty({
                  hints: ['Muito insatisfeito', 'Insatisfeito', 'Indiferente', 'Satisfeito', 'Muito satisfeito'],
                  score: scope[attrs.ngModel] === null || scope[attrs.ngModel] === undefined ? 0 : scope[attrs.ngModel],
                  click: function(score, event) {
                      scope[attrs.ngModel] = score;
                      console.log('Current ' + attrs.ngModel + ' value: ' + scope[attrs.ngModel]);
                  }
              });  
      }
  }
  });
  </code></pre>
  
  <p>My big problem is when I click on the stars. If I click on a star into a component <code>&lt;div ng-model="model.ratedValue" ng-raty&gt;&lt;/div&gt;</code>, this value is not filled properly on the scope. When I click on a star, I set the value of that property into the scope. Displaying on that <code>console.log(...)</code> line, the value is correctly setted. But, when I try to call the same value from the controller, the value is displaying <code>undefined</code> or 0.</p>
  
  <pre><code>patclin.controller('PesquisaPatclinController', ['$scope', 'FormularioService', 
      function($scope, FormularioService) {
  
      $scope.model = {
          ratedValue: 0
      };
      $scope.submit = function() {
          console.log($scope.model.ratedValue);
      }
  }]);
  </code></pre>
  
  <p>I don't know what can be the problem. Can you help me?
  Thanks!!!</p>