Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将重复项保存为图像_Javascript_Angularjs - Fatal编程技术网

Javascript 将重复项保存为图像

Javascript 将重复项保存为图像,javascript,angularjs,Javascript,Angularjs,我的html中有一个ng repeat,它创建了大约750个div(我正在为我的产品制作标签),我已经按照我希望的外观设计了它们,我对此很满意,但由于它们非常大,打印预览看起来与我的设计完全不同 我想知道在Angular中,是否可以轻松地遍历每个ng重复项并将它们保存为png 以下是我的重复: <div class="col-lg-4" ng-repeat="p in productcodes"> <div class="contact-box" style=

我的html中有一个ng repeat,它创建了大约750个div(我正在为我的产品制作标签),我已经按照我希望的外观设计了它们,我对此很满意,但由于它们非常大,打印预览看起来与我的设计完全不同

我想知道在Angular中,是否可以轻松地遍历每个ng重复项并将它们保存为png

以下是我的重复:

<div class="col-lg-4" ng-repeat="p in productcodes">
         <div class="contact-box" style="padding:0px !important;height:370px;width:650px;">
            <span ui-sref="profile">
               <div class="col-lg-3" style="padding:0px">
                  <img alt="image" class="img m-t-xs img-responsive rotateimage" style="max-width:1000% !important;width:200%" ng-src="">
               </div>
               <div class="col-lg-2" style="padding:0px">
                  <div >
                     <h3 style="margin-top:45px;">Code:</h3>
                     <h3>Colour:</h3>
                     <h3>Item:</h3>
                     <h3>EN Cert:</h3>
                     <h3>Size GB:</h3>
                     <h3>Size SE:</h3>
                     <h3>Size EU:</h3>
                     <h3>Length:</h3>
                  </div>
               </div>
               <div class="col-lg-3" style="padding:0px">
                  <h3 style="margin-top:45px;"><strong>{{p.pcode}}</strong></h3>
                  <strong>
                     <h3>{{p.Colour}}</h3>
                  </strong>
                  <h3>
                  {{p.shortdescription}}</h4>
                  <h3>N/A</h3>
                  <strong>
                     <h3>{{p.Size}}</h3>
                  </strong>
                  <h3>C62</h3>
                  <h3>3XL+</h3>
                  <strong>
                     <h3>{{getsize(p.SizeCode)}}</h3>
                  </strong>
               </div>
               <div class="col-lg-4 col-md-12 col-sm-12" style="padding:0px">
                  <img alt="image" class="img-circle m-t-xs img-responsive"  style="margin-top:60px;width:200%;" src=".{{p.localimg}}">
               </div>
               <div class="clearfix"></div>
            </span>
         </div>
      </div>

代码:
颜色:
项目:
电子证书:
大小GB:
尺码SE:
欧盟尺寸:
长度:
{p.pcode}

{{p.color}}

{{p.shortdescription}}
不适用

{{p.Size}}

C62
3XL+

{{getsize(p.SizeCode)}

我想知道在角度上是否可以轻松地迭代 是否将每个ng重复项保存为png

简短回答 没有

长话短说 另存为
png
在哪里?您可以将它们存储在服务器端或您的comp上。它与角度无关。例如,如果要用作图像存储,则可以通过更改URL进行预览:

  • :

此外,一次显示
750张图片
不是一个好的做法,你会毁掉你的网页。请记住,经过2K次观察后,web视图性能会降低

我相信如果你有固定高度的
ng repeat
项,我会使用无限滚动。例如,看一看方法

其他解决方案
如果您的图像预览很小,您可以进行转换,这样您就不用调用750个HTTP请求了

您可以发布Fiddle或Plunkr吗?使用你的代码片段?使用ng src for img tag代码非常无关,我只想将我的750 div保存为750 png。这个链接可以帮助你,