ng-repeat code getting commented out when viewed from browser

ぃ、小莉子 提交于 2019-12-05 02:03:44

问题


I see during load that the scope element $scope.docDetails has the necessary data.

In the view when I use the ng-repeat to print info, I see that it is not displayed in browser.

<body ng-controller="documentUploadController" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">
<div class="container">
    <div ng-repeat="row in documentUploadController.docDetails">
        <div class="col-sm-2">{{row.DocumentTypeName}}</div>
        <div class="col-sm-3 elementwrap"><a href="#" ng-click="documentUploadController.downloadDocument(row)">{{row.FileName}}</a> </div>
 ..
        </div>
    </div>

WHen i view the HTML ,i see the ng-repeat code being commented out

Where am I going wrong?


回答1:


Currently, your ng-repeat variable is $scope.docDetails

Since $scope already equals the controller, remove the controller reference in ng-repeat like <div ng-repeat="row in docDetails">

<body ng-controller="documentUploadController" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter">
<div class="container">
    <div ng-repeat="row in docDetails">
        <div class="col-sm-2">{{row.DocumentTypeName}}</div>
        <div class="col-sm-3 elementwrap"><a href="#" ng-click="documentUploadController.downloadDocument(row)">{{row.FileName}}</a> </div>
 ..
        </div>
    </div>


来源:https://stackoverflow.com/questions/31426872/ng-repeat-code-getting-commented-out-when-viewed-from-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!