AngularJS:追加对每个项目的点击相同的结构 [英] AngularJS : Appending the same structure on the click of each item

查看:116
本文介绍了AngularJS:追加对每个项目的点击相同的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的index.html页面就像是以下几点:

My index.html page is like following:

<div id="sidepanel" ng-controller="myCtrl">
<ul class="drop-down">
    <li ng-repeat="item in items">
        <a href="#">{{item.name}}</a>
    </li>
</ul>
</div>
<div id="mainpanel" ng-controller="listCtrl">
    <div ng-view></div>
</div>

有关这个NG-观点我有记录list.html来显示所有这就像继记录:

For this ng-view I have record-list.html to show all the records which is like following:

<div class="container">
    <ul class="design">
        <li id="{{record.name}}" ng-repeat="record in records">
            <div>......</div>
        </li>
    </ul>
</div>

现在我想添加相同的结构(像每个记录)在侧面板的每个项目的点击追加。

Now i want to add the same structure (as like each record) append on the click of each item of the side panel.

什么是什么逻辑?

我最近的UI看起来这和放大器;我想添加的每个应被现有的结构追加点击相同的结构。

My recent UI Looks like this & i want to add the same structure on each click which should be append the existing structure.

请Help.Thanks。

Please Help.Thanks.

推荐答案

听起来或许每个记录有一组儿童的记录。如果是这样的话,我会建议采用了棱角分明的NG-开关指令有条件地显示在旁边设置的子记录正确的(或没有)。

It sounds like perhaps each "record" has a set of children "records." If this is the case, I would recommend using angular's ng-switch directive to conditionally display the correct (or no) set of sub-records on the side.

这篇关于AngularJS:追加对每个项目的点击相同的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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