1
Ich habe eine Winkel Anwendung whre Ich will Ergebnisse in select
bekommen, so dass ich es so:Winkel Wählen Sie Ergebnisse
HTML
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="form-group">
<label>Register: </label>
<select class="form-control" ng-options="item.Nombre for item in GetCatalogoPadre"></select>
<br />
</div>
</div>
AngularCtrl
function cargarCatalogo() {
apiService.get("../../api/Catalogo/GetCatalogoPadre/", null,
function (res) {
$scope.Catalogos = res.data;
}, errorCatalogo);
Steuerung
namespace PortalDeTransporte.Web.Controllers
{
//[Authorize]
[RoutePrefix("api/Catalogo")]
public class CatalogoRegistroController : ApiControllerBase
{
[System.Web.Http.AllowAnonymous]
[System.Web.Http.HttpGet]
[Route("GetCatalogoPadre")]
public HttpResponseMessage GetCatalogoPadre(HttpRequestMessage request)
{
//some code there for get results
}
return response;
});
}
}
Etwas Extrange es geschieht, wenn ich versuche, Ergebnisse mit GET Aktion wie mit Postbote zu bekommen:
http://localhost:55720/api/Catalogo/GetCatalogoPadre
ich korrekte Ergebnisse wie erhalten:
{
"ID": "1",
"Codigo": "BMX",
"Nombre": "BANAMEX",
"Padre": 0,
"Catalogo": "BAN"
},
{
"ID": "2",
"Codigo": "KNW",
"Nombre": "KENWORTH",
"Padre": 0,
"Catalogo": "MAR"
},
Aber sie nicht erscheinen in Liste auswählen, kann jemand etwas falsch im Code sehen? Grüße
ich es ändern, wie Sie sagen, aber ich nicht Ergebnisse erhalten noch – Ledwing
Sie Ihre Funktion auch als $ scope.cargarCatalogo = Funktion ändern könnte müssen() – Sajeetharan
aber 'res.data' Ergebnisse zu erhalten, wie ich will, warum würde ich es ändern? – Ledwing