I have a question about using angularjs.
Here is the structure of my HTML:
<html>
<body ng-controller="datafileController">
<div class="container">
<center><h1>Datafiles</h1></center>
<div class="row" ng-repeat="i in datafile.items">
<div class="col-sm-8">
<p>Total MB: {{i.total_mb}}</p>
<p>Used MB: {{i.used_mb}}</p>
<p>Free MB: {{i.free_mb}}</p>
<br>
<br>
</div>
<div class="col-sm-4">
<div id="myDiv"></div>
<script>
var data = [{
values: [{{i.used_mb}}, {{i.free_mb}}],
labels: ['Free MB', 'Used MB'],
type: 'pie'
}];
Plotly.newPlot('myDiv', data);
</script>
</div>
</div>
</div>
</body>
</html>
And this is how my controller looks like:
aebdApp.controller('datafileController', function($scope, $http) {
$http.get('http://127.0.0.1:8083/json/datafiles.json').
then(function(response) {
$scope.datafile = response.data;
});
});
Can someone guide me on how to access the i variable in the data section? I want to create a graph using Plotly for each item. Thank you.