I'm building an angular
application and I have a class that I'm defining within another ts file. I'm trying to get a property that is defined by the constructor
but I'm within an object
that is in another object
. Normally I would use the "this" keyword but it is referring to the object
I am in and not the parent class.
here is the use of the class:
var devList = new DateList(dates)
here is a simplified version of the DateList class:
export class DateList {
date
constructor(input){
this.date = input
}
devs = {
bluegreen: {
dates: this.date.bluegreen //<-----------I believe "this" in this
// case refers to bluegreen,
// how do I get it to refer
// to this instance of the
// DateList class?
}
}
}
EDIT
I'm a beginner to programing so I don't understand what a function has to do with an object, inside of another object. can anyone explain how to fix the issue, and how the issue applies to functions?