不在angularjs代码下工作

时间:2015-08-31 07:04:35

标签: angularjs-ng-repeat

<tr data-ng-repeat="myTrack in myTrackList">
<td class="project-status" data-ng-switch="myTrack.opened">
                                        <span  data-ng-switch-when="true" class="label label-primary">Active</span>
                                        <span data-ng-switch-when="false" class="label label-default">Inactive</span>
                                    </td>
                                    <td class="project-title"><a
                                        id="{{myTrack.trackId}},{{myTrack.file.fileId}}"
                                        href="getDocumentByFileId?fileId={{myTrack.file.fileId}}&trackId={{myTrack.trackId}}">{{myTrack.trackName}}</a>
                                        <br /><small>Description: {{myTrack.description}}</small>
                                        <br /> <small>Created: {{myTrack.createdTime}}</small></td>
                                    <td class="project-people" colspan="2">
                                        <div class="project-people" ng-repeat="persons in myTrack.personTrack">                                         
                                            <a href=""><img alt="image" title="persons.firstName"
                                                class="img-circle" src="persons.profilePictureUrl"></a>
                                        </div>
                                    </td>
                                    <td class="project-actions"><a href="#"
                                        class="btn btn-white btn-sm"><i class="fa fa-folder"></i>
                                            View </a></td>
                                </tr>

我拍摄了对象列表,在单个对象中有一组用户带有他们的个人资料图片。我在ng-repeat中使用ng-repeat来重复从对象列表中设置的用户,但我的内部ng-repeat工作不正常。请帮帮我。

1 个答案:

答案 0 :(得分:0)

至于下面的代码:

 <div class="project-people" ng-repeat="persons in myTrack.personTrack">                                         
       <a href=""><img alt="image" title="persons.firstName" class="img-circle" src="persons.profilePictureUrl"></a>
    </div>

浏览器不知道您正在为title或src使用angular js变量。所以你需要。

<div class="project-people" ng-repeat="persons in myTrack.personTrack">                                         
           <a href=""><img alt="image" ng-attr-title="{{persons.firstName}}" class="img-circle" ng-src="{{persons.profilePictureUrl}}"></a>
        </div>

因此,当您想要使用角度js作为标签时,您需要包含ng标签。