Well i have a problem and i would like to know if someone give me an advice.
I want to call the child called File1 using ng-if.
well i want to access inside file1's data.
ang.js
var app = angular.module('app', [])
app.controller("ctrl", function ($scope, $http) {
$scope.files = [];
var promise = $http.get("link1")
.then(function (response) {
console.log(response);
$scope.getfiles = response.data;
return $http.get('link2', {
params: {
id: response.data[0].Id
}
})
})
.then(function (response2) {
console.log(response2);
$scope.files = response2.data;
return response2.data;
})
})
Index
<body ng-app='app'>
<div ng-controller='ctrl'>
<span ng-repeat="get in files">
{{get.files}}
<span ng-if="get.Id== 10303">
<span ng-repeat="child in get.File1">
{{ child.Id}}
</span>
</span>
</span>
</div>
</body>
What's my mistake?, I'm newbie in AngularJs
console.log(JSON.stringify(response))
&console.log(JSON.stringify(response2))
and include the text in your question instead of a screen shot – Professor Allman Jun 10 at 3:03console.log(JSON.stringify(response))
it will create a serialized text representation of the response object. Copy the text from the console and paste it into your question. – Professor Allman Jun 10 at 3:10