Javascript 根据表格中的不同变量类型输入选择

Javascript 根据表格中的不同变量类型输入选择,javascript,html,arrays,angular,typescript,Javascript,Html,Arrays,Angular,Typescript,在我的项目中,我在一个表格中发现了一个问题,在该表格中,我选择了干预类型。有些干预措施是独特的,有些干预措施有变体。当选择变量(例如)c时,问题就会出现,始终获得对a类型变量的干预。 从一开始,我就有了这类课程: ------------- Intervention ------------- id: number code: string description: string ----------------------- InterventionAssociation ---------

在我的项目中,我在一个表格中发现了一个问题,在该表格中,我选择了
干预类型。有些干预措施是独特的,有些干预措施有变体。当选择变量(例如)
c
时,问题就会出现,始终获得对
a
类型变量的干预。 从一开始,我就有了这类
课程

-------------
Intervention
-------------
id: number
code: string
description: string

-----------------------
InterventionAssociation
-----------------------
id: number
intervention: Intervention
price: number
variant: string

variants?: string[] //used for contain all variants


干预中的现有数据示例如下:

[1 , "A", "good"] 
[2 , "B", "ok"]
[3 , "C", "no"]

[1 , 1 , 22.16 , null] 
[2 , 2 , 18.17 , "a"]
[3 , 2 , 32.15 , "b"]
[4 , 3 , 10.29 , null]
 
AssociationIntervention中的当前数据示例如下:

[1 , "A", "good"] 
[2 , "B", "ok"]
[3 , "C", "no"]

[1 , 1 , 22.16 , null] 
[2 , 2 , 18.17 , "a"]
[3 , 2 , 32.15 , "b"]
[4 , 3 , 10.29 , null]
 
我的页面上的表格如下所示:


代码
价格
挑选
{{type.intervention.code}-{{type.variants[j]}
{{type.price[j]}