Hello there! As a beginner in html and angularjs, I'm experimenting with dynamically assigning span width based on an angular js response.
<div class="statarea" ng-repeat="x in names">
<div class="ratingarea">
<div class="your-rating"><span style="width:"+{{ x.width }}+";" class="outer"></span>
</div>
<div class="clear"></div>
</div>
</div>
Here's a snippet of my script:
$http.get(url).success(function (response) {
$scope.names = response;
});
The response data looks like this:
[
{"width":"78%"},
{"width":"60%"},
{"width":"50%"}
]
I realize it may not be perfect, but I'm learning as I go. Any tips would be greatly appreciated!