Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

javascript - How to overcome maximum call stack size exceeded in typescript, nodejs & angular

I've been working at debugging this for days now! I'm trying to pull the database values from Firebase Real Time database. But the below snippet

get assessmentForm(): FormGroup {
    return this._assessmentForm as FormGroup;
  }
question from:https://stackoverflow.com/questions/66056636/how-to-overcome-maximum-call-stack-size-exceeded-in-typescript-nodejs-angular

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You are recursively calling your getter from within the getter implementation:

get _assessmentData():AssessmentInterface {
    return this._assessmentData;
}

You probably meant to reference a private data member, something like:

private _privateAssessmentData: AssessmentInterface;
get _assessmentData():AssessmentInterface {
    return this._privateAssessmentData;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...