如何在angular 2 application

时间:2016-12-03 05:36:24

标签: api angular typescript

我正在开发angular 2应用程序,在我目前的项目中,我使用API​​概念实现了查找主机和查找详细信息策略的功能。

在我的angualr2应用程序中,我使用Http Get请求从这些表中获取数据,但是当LookupMasterId与LookupMasterFkId匹配时,我希望将视图中的数据绑定为LookTypevalue。

我的表格结构如下。

context.LookupMasterTables.AddOrUpdate(

            new LookupMasterTable() { ID = 1, LookupType = "AssetType"},
            new LookupMasterTable() { ID = 2, LookupType = "IntendedUse" },
            new LookupMasterTable() { ID = 3, LookupType = "VehicleYear" },
            new LookupMasterTable() { ID = 4, LookupType = "VehicleMake" },
            new LookupMasterTable() { ID = 4, LookupType = "VehicleModel" }

         );
        context.LookupDetailsTables.AddOrUpdate(

           new LookupDetailsTable() { ID = 1, LookupValue = "Auto", LookupMasterFKId=1 },
           new LookupDetailsTable() { ID = 2, LookupValue = "MotorCycle", LookupMasterFKId = 1 },

           new LookupDetailsTable() { ID = 3, LookupValue = "Personal", LookupMasterFKId = 2 },
           new LookupDetailsTable() { ID = 4, LookupValue = "Business", LookupMasterFKId = 2 },

           new LookupDetailsTable() { ID = 5, LookupValue = "1999", LookupMasterFKId = 3 },
           new LookupDetailsTable() { ID = 6, LookupValue = "2000", LookupMasterFKId = 3 },
           new LookupDetailsTable() { ID = 7, LookupValue = "2001", LookupMasterFKId = 3 },
           new LookupDetailsTable() { ID = 8, LookupValue = "2002", LookupMasterFKId = 3 },

           new LookupDetailsTable() { ID = 9, LookupValue = "Honda", LookupMasterFKId = 4 },
           new LookupDetailsTable() { ID = 10, LookupValue = "Victory", LookupMasterFKId = 4 },
           new LookupDetailsTable() { ID = 11, LookupValue = "Indian", LookupMasterFKId = 4 },
           new LookupDetailsTable() { ID = 12, LookupValue = "Harley-Davidson", LookupMasterFKId = 4 },

           new LookupDetailsTable() { ID = 9, LookupValue = "Octane", LookupMasterFKId = 5 },
           new LookupDetailsTable() { ID = 10, LookupValue = "BMW", LookupMasterFKId = 5 },
           new LookupDetailsTable() { ID = 11, LookupValue = "Audi", LookupMasterFKId = 5 },
           new LookupDetailsTable() { ID = 12, LookupValue = "Swift", LookupMasterFKId = 5 }

        );

我的html(查看)如下图所示。 enter image description here

enter image description here

你能告诉我怎么做。

-Pradeep

0 个答案:

没有答案