Stiahnutie JSON tabuľky.
MCU (http status:{{status}}) |
---|
{{x}} |
<script src=https://ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.min.js></script>
<div ng-app="myApp" ng-controller="myCtrl">
<table class="table">
<tr>
<th>MCU (http status:{{status}})</th>
</tr>
<tr ng-repeat="x in mcu | orderBy">
<td>{{x}}</td>
</tr>
</table>
</div>
var app = angular.module('myApp', []);
app.controller('myCtrl', ['$scope', '$http', function($scope, $http) {
$scope.mcu = [''];
/* list.json
{
"list": [
"ATtiny13A",
"ATtiny85"
]
}
*/
$http.get('/application/data/avr/list.json').
then(function(response) {
$scope.status = response.status;
$scope.mcu = response.data.list;
}, function(response) {
$scope.mcu = ['Request failed'];
$scope.status = response.status;
});
}]);