For handling image/file upload handling in Angular we can use below code. We can also change the file size and file type also. Firstly Create a directive NgImageUploadDirective import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
@Directive({
selector: '[ngImageUpload]'
})
export class NgImageUploadDirective {
@Input() maxSize: number = 5242880…