KeenUser KeenUser - 1 month ago 12
AngularJS Question

ng-repeat code getting commented out when viewed from browser

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?

Answer

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>
Comments