https://jsfiddle.net/6f8upe80/
private sports: any = {
networkNo: 241,
startDate: "04/10/2018",
endDate: "04/24/2018",
addOns: [
"sports"
]
}
//console.log("this--->" , this);
console.log("this.sports.addOns--->" + this.sports.addOns);
答案 0 :(得分:1)
如果您只是想找到一种方法来访问该值,您可以在本地范围内声明该变量并访问它。
let sports: any = {
networkNo: 241,
startDate: "04/10/2018",
endDate: "04/24/2018",
addOns: [
"sports"
]
}
console.log("this.sports.addOns--->" + sports.addOns);