Reputation: 301
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
}
Upvotes: 1
Views: 984
Reputation: 185
//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){}
Upvotes: 1
Reputation: 121
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
Upvotes: 1