The files does not send.
The file is not attached in the click event.
Via console the json is shown empty.
<form #form="ngForm" enctype="multipart/form-data" novalidate>
<input type="file" id="file" name="file1" class="form-control" ngModel>
<input type="file" id="file" name="file2" class="form-control" ngModel>
<button class="btn btn-primary" (click)="envirArquivos(form.value)">Enviar</button>
</form>
File ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'mw-compare-nfe',
templateUrl: './compare-nfe.component.html'
})
export class CompareNFEComponent implements OnInit {
constructor() { }
ngOnInit() {
}
envirArquivos(form) {
console.log(form);
}
}
{"file1":"","file2":""} empty