动态添加具有相同结构的多个表,并在angularjs中使用不同的集合 [英] Dynamically add multiple table with same structure with different collections in angularjs

查看:134
本文介绍了动态添加具有相同结构的多个表,并在angularjs中使用不同的集合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

请帮我以下要求。

我有一个html表,有两列,包含文本框

和用户可以使用添加行按钮添加多行。

所以我将一个集合绑定到表并且工作正常。

我想要的是用户点击AddnewTable按钮然后相同table stracture应该用一行创建。他们输入的数据将在数组中出现。



我尝试过:



我使用bootstrap创建多个选项卡

默认的第一个选项卡包含带有两个冒号的html表和一行(td包含文本框)。

如果用户点击addNewTab按钮然后将创建具有相同表结构的新选项卡。但是如果我在第二个表中添加行,它也会在第一个表中创建相同的行。事件我在第一个表格行输入相同的文字正在第二个表格中输入。

Hi All
Please help me on below requirement.
I have one html table with two columns it contains text box
and user can add multiple rows using add row button.
so i have bind one collection to table and its working fine.
what i want if user will click on AddnewTable button then same table stracture should be create with one row. and their entered data will come in array.

What I have tried:

I have create multiple tab using bootstrap
the default first tab contains html table with tow colons and 1 row (td contains textbox).
if user will click on addNewTab button then new tab with same table structure will be create.But if i add row in second table it also creating same row in first table also. event i typed something in first table row same text is entering in second table.

推荐答案

你好,



根据您的试验,似乎将更改添加到同一范围。您始终可以调试并检查添加的范围。使用 Angular BatRang Google Chrome扩展程序。

AngularJS Batarang(稳定版) - Chrome网上应用店 [ ^ ]

在角度中,跟踪
Hello,

Based on your trials, it seems that the changes are being added to the same scope. You can always debug and check to which scope it gets added. Use Angular BatRang Google chrome extension.
AngularJS Batarang (Stable) - Chrome Web Store[^]
In angular it is very important to track the


范围/这是非常重要的,以便维护稳定性和特定元素的变化。



请尝试这样做,否则粘贴你的代码以便更好地理解我们。

谢谢
scope/this inorder to maintain the stability and changes to particular elements.

Please try this else paste your code for better understanding to us.
Thanks


这篇关于动态添加具有相同结构的多个表,并在angularjs中使用不同的集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆