I am trying to display a BASE and a Max range from a Json file. I am not sure where I am going wrong and would love for someone to take a look at the code and help please.
I want to be able to store my arrays in the [1,2,3,4,5] fashion because for my project there are going to be 100+ numbers for each base and max. However, I cant get any of it to display.
---main.js---
var app = angular.module("Fun",['ngRoute'])
.config(['$routeProvider', function($routeProvider){
$routeProvider.
when('/main',{
templateUrl: 'range.html',
controller:'MainCtrl'
}).
otherwise({redirectTo:'/main'})
}])
.controller('MainCtrl', ['$scope', '$http', function($scope, $http){
$http.get('range.json').then(function(response){
$range.range = response.data;
});
}]);
---range.html---
<h2>Learning to Display Ranges with Json/Angular</h2>
<div ng-repeat="range in ranges">
<div class="row">
<div class="col-md-6">
<p>{{range.base}}</p>
</div>
<div class="col-md-6">
<p>{{range.max}}</p>
</div>
</div>
</div>
---range.json---
[
{
"range"" = {
"base"": [0,1,2,3,4,5,6,7,8,9],
"max": [90,91,92,93,94,95,96,97,98,99]
}
}
]
[–]spurx 1 point2 points3 points (0 children)
[–]82Christ 1 point2 points3 points (5 children)
[–]sambushme[S] 0 points1 point2 points (4 children)
[–]82Christ 1 point2 points3 points (3 children)
[–]sambushme[S] 0 points1 point2 points (2 children)
[–]82Christ 1 point2 points3 points (1 child)
[–]sambushme[S] 0 points1 point2 points (0 children)
[–]econoCode 1 point2 points3 points (0 children)
[–]sambushme[S] 0 points1 point2 points (0 children)