1

In my Angular Typescript file, I have 2 functions data and lists. I am trying to pass variable windows from function data to function lists.

I am getting Cannot find name 'back'. Did you mean the instance member 'this.lists'?ts(2663) error when trying to call function lists

UPDATE

If I use this.list, When I console.log(windows), it gives undefined

data(less: Mark, quick: HTMLTableDataCellElement) {
  const { a,b,c } = less;
  const windows = quick.innerText;
  lists(windows);     ------>>>>> Cannot find name 'lists'. Did you mean the instance member 'this.lists'

  this.value.newLevel({a, b, c windows}).subscribe(data => {
    this.processView(data);
  })
}

lists(windows){
 console.log(windows) ---> If I use this.lists the value is undefined
}
3
  • 4
    Did you mean this.lists? What happens if you try that? Commented Mar 19, 2021 at 17:04
  • @luk2302 If I use this.list, When I console.log(windows), it gives undefined Commented Mar 19, 2021 at 19:10
  • @TejasMehta When you are using this.lists you are getting undefined because quick.innerText is undefined Commented Mar 20, 2021 at 9:31

2 Answers 2

1

List is in the same class, so you are trying to access a function inside an object. Instead of calling list, you have to call this.list

Sign up to request clarification or add additional context in comments.

2 Comments

If I use this.list, When I console.log(windows), it gives undefined
are you sure that quick.innerText is not undefined? Try to console.log quick and then see if this object has innerText as a property
1
//Here is your solution             
data(less: Mark, quick: HTMLTableDataCellElement) {
const { a,b,c } = less;
const windows = quick.innerText;
this.lists(windows);

this.value.newLevel({a, b, c windows}).subscribe(data => {
  this.processView(data);
})
}
lists(windows){}

2 Comments

If I use this.list, When I console.log(windows), it gives undefined
use another naming convention instead using windows.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.