The json I'm working with goes something like this:
{
nameofProduct: {
Alive: {
ImServer1: {
status: "low",
title: "ImServer1"
},
ImServer2: {
status: "high",
title: "Imserver2"
},
ImServer3: {
status: "medium",
title: "ImServer3"
}
I'm trying to display the name ImServer1, ImServer2, ImServer3 and their status and title inside.
My angular js. js file looks like this
var app = angular.module("nameofproduct", []);
app.controller("MainController", function($scope, $http) {
$scope.loading = true;
$http.get('https://jsonp.nodejitsu.com/?url=http://jsonp.jit.su/?url=httpfakeurl.com').
success(function(data, status, headers, config) {
$scope.Servers = data;
$scope.loading = false;
}).
error(function(data, status, headers, config) {
console.log(data);
});
});
Currently I have my html set up like this:
<body ng-app="nameofproduct">
<div ng-controller="MainController">
<div class="col-lg-6" ng-repeat="server in Servers">
<div class="col-lg-6">{{server.nameofServer.Alive}} </div>
<div class="col-lg-1"><i class="{{server.status == 'low' ? 'thumbs-down' : 'humbs-up'}}" style="{{server.status == 'low' ? 'color:red;' : 'color:green;'}}"></i></div>
<div class="col-lg-5">
<span class="badge" ng-class="{'badge-offline': server.status == 'low', 'badge-low': server.status == 'Low', 'badge-medium': server.status == 'medium', 'badge-high': server.status == 'high', 'badge-vhigh': server.status == 'evry high'}">{{server.status}}
</span>
</div>
But at the moment is just displays all the data, and doesn't split it apart. I'm not sure what I'm missing and how to proceed.