Javascript 如何将div中的值传递给angular js中的另一个div
我正在尝试使用ng-repeat动态生成角度材质卡。我从json数组中获取了一些值,并显示在第一个div中。单击第一个div后,它应该转到下一个div,并显示我先前获取到第一个div的一些数据 html页面Javascript 如何将div中的值传递给angular js中的另一个div,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,我正在尝试使用ng-repeat动态生成角度材质卡。我从json数组中获取了一些值,并显示在第一个div中。单击第一个div后,它应该转到下一个div,并显示我先前获取到第一个div的一些数据 html页面 <div class="col-md-12 padding_top_2px animate-hide" ng-repeat="data in personaldata.data.result" ng-click="showHistory(data)" ng-show="activeAc
<div class="col-md-12 padding_top_2px animate-hide" ng-repeat="data in personaldata.data.result" ng-click="showHistory(data)" ng-show="activeAction == 'get'" >
<div flex-xs flex-gt-xs="100" class="padding_0px margin_top_bottom_10px" layout="row">
<md-card class="width_100 margin_0px padding_10px" md-theme="{{ showDarkTheme ? 'dark-grey' : 'default' }}" md-theme-watch>
<div class="col-md-12 padding_0px font_16">
<table class="width_100" cellspacing="0" cellpadding="0">
<tr>
<td class="width_100 float_left margin_top_2px" valign="top">
<div class="float_left">
<img src="images/rupee.png" class="listViewIcon"/>
</div>
<div class="float_left margin_left_15px">
<div class="width_100 font_700">
{{data.STATEMENT1}}
</div>
<div class="font_size_weight">{{data.receiver_twitter_handle}}</div>
</div>
<div class="float_right margin_top_right_5px_15px">
<span class="float_left"><img src="images/rupee-indian.png" class="rupee_icon_history" /></span>
<span class="margin_left_5px">{{data.total}}</span>
</div>
</td>
<td class="width_100 float_left" valign="bottom">
<div class="timing_days_ago float_left">{{data.created_time}}</div>
<div class="credited_right">credited to </div>
</td>
</tr>
</table>
</div>
</md-card>
</div>
</div>
{{data.STATEMENT1}
{{data.receiver\u twitter\u handle}
{{data.total}
{{data.created_time}
归功于
这是第一组
第二版html
<div class="col-md-12 padding_top_2px animate-hide" ng-show="activeAction == 'success'">
<div flex-xs flex-gt-xs="100" class="padding_0px margin_top_bottom_5px" layout="row">
<md-card class="width_100 margin_0px padding_10px" md-theme="{{ showDarkTheme ? 'dark-grey' : 'default' }}" md-theme-watch>
<div class="col-md-12 padding_0px font_16">
<table class="width_100" cellspacing="0" cellpadding="0">
<tr>
<td class="width_100 float_left margin_top_5px" valign="top">
<div class="font_100 font_family_roboto font_size_12px">
Reference ID
</div>
<div>
{{reference_id}}
</div>
<div class="float_right margin_right_15px margin_top_m_20px">
<span class="float_left"> <img src="images/rupee-indian.png" class="rupee_icon_history" /> </span>
<span class="float_left margin_left_5px"> {{total}} </span>
</div>
</td>
<td class="width_100 float_left margin_top_15px" valign="bottom">
<div>
<div class="font_100 font_family_roboto font_size_12px">
{{statement}}
</div>
<div class="margin_top_20px">
<span class="float_left"><img src="images/twitter.png" class="listViewIcon"/></span>
<span class="own_wallet">FINdigini</span>
</div>
</div>
</td>
</tr>
</table>
</div>
</md-card>
</div>
<div flex-xs flex-gt-xs="100" class="padding_0px margin_top_bottom_5px" layout="row">
<md-card class="width_100 margin_0px padding_10px" md-theme="{{ showDarkTheme ? 'dark-grey' : 'default' }}" md-theme-watch>
<div class="col-md-12 padding_0px font_16">
<table class="width_100" cellspacing="0" cellpadding="0">
<tr>
<td class="width_100 float_left margin_top_5px" valign="top">
<div class="float_left font_100 font_family_roboto font_size_12px">
Created to
</div>
</td>
<td class="width_100 float_left margin_top_15px ">
<div class="margin_left_20px">
<div class="float_left margin_left_20px"> XXXXXXXXXXXXXXXXX345 </div>
<div class="float_right margin_top_right_5px_15px">
<span class="float_left"> <img src="images/rupee-indian.png" class="rupee_icon_history" /> </span>
<span class="float_left margin_left_5px"> {{total}} </span>
</div>
</div>
</td>
<td class="width_100 margin_top_15px float_left" valign="bottom">
<div class="margin_left_20px">
<div class="margin_left_20px">{{reference_id}}</div>
</div>
</td>
</tr>
</table>
</div>
</md-card>
</div>
<div flex-xs flex-gt-xs="100" class="padding_0px margin_top_bottom_5px" layout="row">
<md-card class="width_100 margin_0px padding_10px" md-theme="{{ showDarkTheme ? 'dark-grey' : 'default' }}" md-theme-watch>
<div class="col-md-12 padding_0px font_16">
<table class="width_100" cellspacing="0" cellpadding="0">
<tr>
<td class="width_100 float_left margin_top_5px" valign="top">
<div class="float_left font_100 font_family_roboto font_size_12px">
Need Help?
</div>
</td>
<td class="width_100 float_left margin_top_padding_5px" valign="bottom">
<div class="float_left margin_top_right_5px_15px">
<span class="float_left"><img src="images/info.png" class="question_phone_icon_history" /></span>
<span class="margin_left_20px font_400">Read FAQs</span>
</div>
<div class="float_right margin_top_right_5px_15px">
<span class="float_left"><img src="images/call-answer.png" class="question_phone_icon_history" /></span>
<span class="margin_left_20px font_400">Call me back</span>
</div>
</td>
</tr>
</table>
</div>
</md-card>
</div>
<div class="col-md-12 padding_0px padding_top_bottom_5px text-center">
<div class="col-md-12 padding_0px text_align_center">
<button class="btn1 padding_top_bottom_5px" ng-click="ShowViewHistoryPage()">BACK</button>
</div>
</div>
</div>
</div>
</div>
参考ID
{{reference_id}}
{{total}}
{{语句}}
芬迪基尼
创建为
XXXXXXXXXXXXXXXXXXXXXXXX345
{{total}}
{{reference_id}}
需要帮助吗?
阅读常见问题
给我回电话
返回
如何将值从第一个div传递到第二个div,但值必须基于用户正在单击的卡。它可以通过onclick事件传递吗?请帮助…您只需将ng模型添加到任何元素中,并且您可以在HTML或JS中的任何位置使用该模型,如果您可以具体说明所引用的字段,则可以帮助我编辑代码并将ng模型添加到我想要传递数据的地方使用您想要值的ng模型名称。ng repeat中的数据是从js页面中的另一个函数中提取的。而从第一个div到第二个div的提取是在另一个函数中进行的。因此,它无法相应地获取单击的id根据所选参数显示数据card@KailashPK我跟不上你。从HTML中选取一个场景,解释单击哪个元素以及输出中的期望值