Ich möchte bestimmte Elemente von Objekten anzeigen, die ich von einem Dienst mit ng-repeat empfangen habe. Wenn ich {{account}} verwende, rendert es alle Elemente, aber wenn ich zum Beispiel {{account.idType}} versuche, zeigt es nichts. Was ist los? Hier ist mein HTMLng-repeat zeigt Objekte, aber keine Elemente von Objekten an
<table>
<thead>
<tr>
<th>List of Accounts</th>
</tr>
</thead>
<tbody ng-repeat="account in accounts" ng-if="account.idType != 0">
<tr>
<td>{{account.idType}}</td>
<td>{{account.linkRel}}</td>
<td>{{account.linkURI}}</td>
<td><input type="button" ng-click="editAccount(account.idType)" value="edit"></td>
</div>
und dies ist der Controller:
rest.controller('accountListCtrl',['$scope','$resource','$location','$parse','$routeParams',
function($scope,$resource, $location, $parse,$routeParams)
{
var Account = $resource('http://localhost\\:8085/WSAT/account/');
$scope.accounts = Account.get();
}]);
die Antwort, die ich aus dem Dienst erhalten, ist dies:
{"linklist":[{"idType":"0","linkRel":"Get all accounts","linkType":"Sibling","linkURI":"http://localhost:8085/WSAT/account","linkVerb":"GET"},{"idType":"0","linkRel":"Create a new account","linkType":"Sibling","linkURI":"http://localhost:8085/WSAT/account","linkVerb":"POST"},{"idType":"7","linkRel":"try","linkType":"Child","linkURI":"http://localhost:8085/WSAT/account/7","linkVerb":"GET"},{"idType":"9","linkRel":"try234","linkType":"Child","linkURI":"http://localhost:8085/WSAT/account/9","linkVerb":"GET"}]}
Können Sie zeigen Sie Ihre Response-Objekt von dem Endpunkt? Schwer zu beheben, ohne zu sehen, was zurückkommt. – user2263572