When I try to access test json data, it retrieves the data. however it won't display within my template
app.js:
var listController = angular.module('ngAppListDemo', []);
listController.controller('listControl', ['$scope', '$http', function ($scope, $http){
$scope.list = [];
var urlTest = 'https://mysafeinfo.com/api/data?list=englishmonarchs&format=json'; // url
//var testData = 'http://raw.githubusercontent.com/zemirco/sf-city-lots-json/master/citylots.json'; // .json format
$http({method: 'GET', url: urlTest}).success(function(data, status, headers, config) {
$scope.list = data;
console.log(data);
});
}]);
index.html
<div ng-app="ngAppListDemo">
<div ng-controller="listControl">
<div class="row" ng-repeat="item in list">
<p>{{item.nm}}</p>
</div><!-- end list item -->
</div>
</div>
data looks like this within url:
[
{
"nm": "Edmund lronside",
"cty": "United Kingdom",
"hse": "House of Wessex",
"yrs": "1016"
},
{
"nm": "Cnut",
"cty": "United Kingdom",
"hse": "House of Denmark",
"yrs": "1016-1035"
},
{
"nm": "Harold I Harefoot",
"cty": "United Kingdom",
"hse": "House of Denmark",
"yrs": "1035-1040"
}
]
It's repeating within the template fine. but the data inbetween the <p> tags {{ item.nm }} doesn't show. What am I missing?
Edit: It appears that ng-binding is missing once rendering.
successanymore. docs.angularjs.org/api/ng/service/$http#deprecation-notice.then(function successCallback(response) { ...however, its still not replacing correctly.