Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 991
KeenUser Avatar asked Jul 15 '15 09:07

KeenUser


People also ask

Should I remove the comments in angular code?

Removing the comments, in my opinion, would only keep casual peekers from getting a look at your logic. It won't deter an attacker, and i'd be highly surprised if an attacker would even consider your angular comments as the route to finding a possible exposure or weakness in your code.

What is ng-repeat directive in angular?

The ng-repeat directive repeats a set of HTML, a given number of times. The set of HTML will be repeated once per item in a collection. The collection must be an array or an object.

What is ng-repeat in HTML?

1 Definition and Usage. The ng-repeat directive repeats a set of HTML, a given number of times. The set of HTML will be repeated once per item in a collection. 2 Syntax. Supported by all HTML elements. 3 Parameter Values. An expression that specifies how to loop the collection. 4 More Examples

How to extend the range of the repeater using ngrepeat?

To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending the range of the repeater by defining explicit start and end points by using ng-repeat-start and ng-repeat-end respectively.


1 Answers

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>
like image 197
Chander .k Avatar answered Oct 19 '22 19:10

Chander .k