从浏览器查看时,ng-repeat 代码被注释掉 [英] ng-repeat code getting commented out when viewed from browser

查看:32
本文介绍了从浏览器查看时,ng-repeat 代码被注释掉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在加载过程中看到范围元素 $scope.docDetails 具有必要的数据.

在我使用 ng-repeat 打印信息的视图中,我看到它没有显示在浏览器中.

<div class="容器"><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>

..

当我查看 HTML 时,我看到 ng-repeat 代码被注释掉了

我哪里出错了?

解决方案

目前,你的 ng-repeat 变量是 $scope.docDetails

由于 $scope 已经等于控制器,删除 ng-repeat 中的控制器引用,如 <div ng-repeat="row in docDetails">

<div class="容器"><div ng-repeat="文档详细信息中的行"><div class="col-sm-2">{{row.DocumentTypeName}}</div><div class="col-sm-3 elementwrap"><a href="#" ng-click="documentUploadController.downloadDocument(row)">{{row.FileName}}</a>

..

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?

解决方案

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>

这篇关于从浏览器查看时,ng-repeat 代码被注释掉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆