http応答後に「user」フィールドが更新されましたが、エラーが発生します。http応答でデータが更新されていません
エラー:[5 @ ProfileComponentに名前提出{{user.firstName}}:3]に未定義の 'firstNameの' プロパティを読み取ることができません
私は<p> {{user | json}} </p>
を書く場合、私は、 "ユーザー" フィールドの値を参照してください。
コンポーネント
export class ProfileComponent implements OnInit {
title:string = "Profile";
public user:User;
constructor(private _stateService:StateService,
private _profileService:ProfileService) {
}
ngOnInit():any {
this._profileService
.getMe()
.subscribe(
user=> this.user = user
)
}
}
Htmlの
<p>{{ user.firstName }}</p>
質問が更新されました。それはすでにそれのようです。 –
質問をもう一度更新しました。さて、ユーザーは '.firstname'プロパティを持っていませんか? – micronyks
'{{user | json}}'はどのように見えますか? – micronyks