草庐IT

QuestionResponse

全部标签

javascript - 使用 typescript 使用模板创建 HTML

尝试typescript,我想实现以下目标:使用typescript从服务器获取问题文本和数字并将其显示在某处的DOM中。目前我有以下.ts文件:classQuestionResponse{constructor(publicquestionText,publicquestionNumber){}}functionquestioner(question:QuestionResponse){return'${QuestionText}';}vartestQuestion=newQuestionResponse("Questiontextnumber5",5);//thiswillbere