Angular P-FileUpload ng-template not working

Discussão em 'Angular' iniciado por Imran Ahmad Shahid, Dezembro 8, 2024.

  1. I am trying to use p-fileupload in angular for the pdf files, when I select the file, I want to put the pdf image along with the file name. For that, I created the ng-template for the file upload but apparently I am getting the template version as well as the default version of the file upload. How I am remove the default version of the p-fileupload files.

    [​IMG]

    here is the code for my file uploader.

    <p-fileUpload
    #uploader
    [multiple]="true"
    [maxFileSize]="1000000"
    [fileLimit]="5"
    dragDropSupport="true"
    [showUploadButton]="false"
    [customUpload]="true"
    (onSelect)="onSelectFile($event, uploader)"
    accept="application/pdf"
    >
    <ng-template pTemplate="content">
    <ul *ngIf="uploader.files">
    <li *ngFor="let file of uploader.files">
    <img
    src="/assets/images/pdfimage.png"
    />
    {{ file.name }}
    </li>
    </ul>
    </ng-template>
    </p-fileUpload>

    Continue reading...

Compartilhe esta Página