加载正确的儿童角误差 [英] Angular error in loading correct children

查看:103
本文介绍了加载正确的儿童角误差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的角应用:

plunker

当点击+旁边的我的学术课程,它会打开一个新的面板来获得课程从选择列表。在这里,当我们点击学术它显示了其所有的孩子一个新的面板。但是当我点击专科应用科学学位它仍然显示我一样的孩子吗?任何想法,我错了?

When the + next to the My academic course is clicked, it opens a new panel to get a list of courses to select from. Here when we click 'Academic' it shows a new panel with all its children. But when i click Associate in Applied Sciences Degree it still shows me the same children? Any ideas where i am going wrong?

推荐答案

可能不是最好的解决办法,但这里是链接到的 plnkr

Might not be the best solution but here is the link to plnkr.

修改:对于subchildren: plnkr (<一href=\"http://stackoverflow.com/questions/23200584/angular-error-in-loading-correct-children?noredirect=1#comment35499267_23200584\">from评论)。这仍然有不少的bug(如:试着点击两个复选框:D)

EDIT: For subchildren: plnkr (from comment). This still has quite a few bugs (like: try clicking both checkboxes :D)

下面是我的加法:
控制器:

$scope.clickHandler = function (index) {
    $scope.currentProgram = $scope.programs[0].programlist[index];
};

查看:

 <li ng-repeat="p in programs[0].programlist" data-spy="scroll" >
                  <input type="checkbox" ng-click="display.addcourse = !display.addcourse; clickHandler($index)" value=""/>{{p.program}}
  </li>

  ...

    <div ng-show="display.addcourse" class="col-lg-4 col-md-4 col-sm-4">
        <div class="panel panel-info">
            <ul class="list-group" role="menu">
                <li ng-repeat="p in currentProgram.children" data-spy="scroll" class="list-group-item">
                    <a ng-click="display.addcoursedescription = true" >{{p.course}}</a>
                </li>
            </ul>
        </div>
    </div>

这篇关于加载正确的儿童角误差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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