Read Data from .html to .ts file

//in home.ts file
@Input(“UserData”) UserData: User[ ];

I have UserData that that is read from a different page as above. The data is available and being used in the home.html page BUT, when I console I get undefined.

Since it’s available at html level, how can I read it in the home.ts file?

This shoudn’t really work, I guess.

But can you show the HTML and TS file so we can see what is happening?

sorry it took me quite long to reply to you. I got the solution that involves event listeners. the home.htm/ts recieves data from another page, initpage.ts

async getUsers() {
    await this.user.getAppUsers().subscribe(
      users => {
        this.UsersData =;"userData", this.UserData);
      error => {
        throw error;
  <user-list  [UserData]="UserData">

Then in home.ts I subscribe to the data as;

ngOnInit(): void {"userData", data => {
      this.uData = data;

Although I still not get why I am not able to get data for user UserData
//declared at home.ts
@Input(“UserData”) UserData: User[ ];
lf i log UserData it will result to undefined, but available for use in home.html

@Input is resolved at a time when your async function has not yet returned a value.

Best regards, anna-liebt