1

So I want to diplay user information in the Profilecomponent, but whenever I run the server I get the same message two times: Property 'user' does not exist on type 'ArrayBuffer'. I have tried to look it up but so far I havent got any clue what is causing this. Can anyone help? This is profile.component.ts:

  username;
email;

constructor(private auth: AuthService) { }

ngOnInit() {
this.auth.getProfile().subscribe(profile => {
  this.username = profile.user.username;
  this.email = profile.user.email;

  })
}

1 Answer 1

2

Try changing the response as any, in this case,

this.auth.getProfile().subscribe((profile:any) => {
  this.username = profile.user.username;
  this.email = profile.user.email;
})
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.