I am using ui-bootstrap rating directive, and have encountered something weird.
Below is the markup used for the directive. Two variables are passed into the directive, rateValue and rateMax
<div class="ratingContainer textCentered">
<rating value="rateValue" max="rateMax"></rating>
</div>
<h4>
{{rateValue}} / {{rateMax}}
</h4>
The weird thing is that i can see the rateValue variable being updated in the view, when i select different numbers of stars. But the variable's value isnt updated in the $scope view model.
app.controller( 'addModalCtrl', function($scope, $modalInstance, selectedMovie, myMovieService ) {
$scope.rateValue = 0;
$scope.rateMax = 10;
$scope.selectedMovie = selectedMovie;
$scope.addToLib = function( item ) {
var jsonData = {
tmdb_id: $scope.selectedMovie.id,
my_rating: $scope.rateValue //this always remains 0
};