Reputation:
I have a function of image inputs. How can I remove the box border when a file is in that box?
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>
Upvotes: 1
Views: 32
Reputation: 6811
you can do like this :
<div class="drop" [style.border-width.px]="urls.length > 0 ? 0: 3">
You can read the Cheat sheet from Angular, you will learn a lot of interesting methods.
Upvotes: 2