有文件时删除边框

时间:2019-11-05 19:44:42

标签: html angular

我具有图像输入功能。当文件位于框内时,如何删除框框?

HTML

 <div class="col-md-6">
    <div class="drop">
      <div class="cont">
      </div>
      <div  *ngIf="urls.length > 0">
          <img [src]="urls[0]"><span class="delete" style="cursor: pointer;" (click)="delete(urls[0])">X</span>
      </div>
        <input type="file" id="files" multiple (change)="detectFiles($event)" accept="image/*">
    </div>

      <div class="U" *ngFor="let url of urls" >
          <img [src]="url" style="width: 100%;"><span class="delete" style="cursor: pointer;" (click)="delete(url)"></span>
    </div>

1 个答案:

答案 0 :(得分:2)

您可以这样做:

import re
import glob
import ntpath
import os

output_dir = "output"

if not os.path.exists(output_dir):
os.makedirs(output_dir)

old_company_name_pattern = re.compile('ABC Divisionname ProductName|Divisionname ProductName')
for f in glob.glob("*.xml"):
    with open(f, 'r', encoding='utf-8') as inputfile:
        with open('%s/%s' % (output_dir, ntpath.basename(f)), 'w',       encoding='utf-8') as outputfile:
        for line in inputfile:
            outputfile.write(re.sub(old_company_name_pattern,'ProductName',line))

您可以从Angular中阅读Cheat sheet,您将学到很多有趣的方法。