I am trying to use angular to send data from parent to child component. In my parent component I use a onclick event to send data to my child component.
In my child component user-profile.ts i have this:
@Input('user')
set user(user: any) {
}
I know that the component recieved the data because if i console.log(user) it shows the data. However it doesnt see the data in the html. In the html of this file i have this
<h1>
{{ user.name }}
</h1>
But i then get the error: "Cannot read property 'name' of undefined". What logic do i put into my .ts file to fix this?