0
I have a little problem in Angularjs
I need to pull the array values
angular.module('app', [])
.controller('Ctrl', ['$scope', function($scope) {
$scope.data = [{
a: 1,
b: 2,
c: [{
d: "z",
e: "4"
},{
d: "z",
e: "4"
}]
}];
}]);
Html
<div ng-repeat="i in data">
<p>Não puxa: {{i.c.d}}</p>
<p>Puxando o Valor: {{i.c.0.d}}</p>
</div>
And unfortunately I can’t pull. Follow Link: http://plnkr.co/edit/Jdym3w7eT0KSMZAD72V4?p=preview
Good afternoon, all right? I want a loop in {{c.d}} E that way of the Error.. Follow my link http://plnkr.co/edit/Jdym3w7eT0KSMZAD72V4?p=preview Thank you.
– Dener Troquatte
You have a rather inconsistent structure. It starts with a
array
of 1 single element, this element that is inside has some attributes, being new hoursarrays
, hours possessing a value or still being a new element. Are you aware of this? Here is a suggestion of how to improve it a bit, or at least to be able to iterate to the levelc
: http://plnkr.co/edit/OcYQ3HJiMlSYNCm1a7nK– Giuliano Griffante
Another suggestion, use key/value to iterate an object, as long as it is actually an object, example for its data source: http://plnkr.co/edit/W2zyCulaZtrbODPlnK42
– Giuliano Griffante