I am new to Ionic so this may be a basic question.
I have an HTML file with the following code:
<ion-item class="item-remove-animate item-icon-right" href="#/editvenue/{{venueItem.id}}"
ng-repeat="venueItem in venue track by venueItem.id">
<h2>{{venueItem.name}}</h2>
<p>{{venueItem.phone}}</p>
<ionic-ratings ratingsobj='rating'></ionic-ratings>
</ion-item>
The is used to display star ratings using a custom directive. See details here: https://market.ionic.io/plugins/ionicratings. Below is part of the controller in app.js file that includes the code used to generate the stars.
$scope.rating = {
iconOn: 'ion-ios-star',
iconOff: 'ion-ios-star-outline',
iconOnColor: 'rgb(255, 215, 0)',
iconOffColor: 'rgb(224, 224, 224)',
rating: 0,//$scope.venueItem.overallrating, // NEED TO DEFAULT THIS TO A RATING???
minRating: 0,
readOnly: true, // Set to true so user cannot edit rating
callback: function(rating) { //Mandatory
// do nothing as read only stars
}
};
I am trying to pass the overallrating value from the current venueItem variable as ng-repeat iterates through the list of venues back to the controller. The goal is to show the star ratings for each venueItem. I am trying to set rating to $scope.venueItem.overallrating but this isn't working.