angular - Angular 中 WebService 上的下拉列表
问题描述
我有一系列关于网络服务的问题。
我知道如何通过 for 循环检索我的录音(我的问题)。
HTML
<ul class="listing" *ngFor="let item of questions" >
<li>- {{item}}</li>
</ul>
TS
questions;
selectedQuestion;
this.api.getUserStatus(this.user)
.subscribe((response) => {
console.log("HELLO : " + JSON.stringify(response));
if (response['PAGEACCEUIL'].ISFIRST == "TRUE") {
this.goToFase(3);
} else {
this.goToFase(2);
}
this.questions = response['PAGEACCEUIL'].TEXTE.QUESTION
this.selectedQuestion = response['PAGEACCEUIL'].TEXTE.QUESTION
console.log("My Questions (Display): " + JSON.stringify(this.questions));
console.log("My Questions (DROPDOWN) : " + JSON.stringify(this.selectedQuestion));
});
我得到我的录音
现在,我想使用一个下拉列表,但我不懂语法...
我的下拉列表是空的……我检索了 11 次item
,但不是我的录音。
<select>
<option *ngFor="let item of selectedQuestion"> {{item}</option>
</select>
解决方案
推荐阅读
- basic - Visual Basic 窗体下拉
- swift - ARWorldTrackingTechnique:世界跟踪性能受到资源限制的影响 [1]
- html - 如何使用 flex 使 div 与兄弟和溢出-y auto 具有相同的高度
- unity3d - Unity - AudioClip 数组的问题
- java - Java创建excel文件但我无法打开文件
- c - CS50 pset1 校验和计算中的信用错误
- android - 主 Activity 文件中的渲染问题 - Android Studio
- python - 有没有办法让 os.walk 返回文件夹的孩子,而不是后代?
- buildfire - BuildFire 自定义插件导航
- java - 如何在运行时更改 build.gradle 中的 mainClassName?