ngOnInit() {
this.allusers = [];
this.authService.getallUsers(this.allusers)
.subscribe(
(response) =>console.log(response),
(error) =>console.log(error)
);
console.log(this.users);
}
すべてのユーザー(first_name、last_name、email)を読み込もうとしています。 ":" 1" 、 "FIRST_NAME": "renuka"、 "LAST_NAME": "ネイヤー"、 "電子メール": "renukaする@ gmailのAngular2の* ngForの応答データを取得する方法
"[{" IDの下に与えられたように私は結果を取得しています。 "[email protected]"}、{"id": "3"}、{"id": "2"、 "first_name": "renuka"、 "last_name": "nayer" 、 "first name": "renuka"、 "last_name": "nayer"、 "email": "[email protected]"}、{"id": "4"、 "first_name": "Rakesh"、 "last_name" "[email protected]"}、{"id": "5"、 "first_name": "Rakesh"、 "last_name": "R"、 "email": "rakeshjack7 + [email protected] "}]"
親切
するレコードを取得するのに役立ち
[非同期呼び出しからの応答を返すにはどうすればよいですか?](https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous- call) – Igor
上記のコードでは、データは 'response'として到着します。どうしたの? – BeetleJuice
ここでngForはどこですか? – Vega