This commit is contained in:
Peter Maquiran
2021-08-23 15:18:43 +01:00
parent d50604d84e
commit 3251144704
4 changed files with 78 additions and 0 deletions
@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class FileLoaderService {
constructor() { }
loadeFile({ type = 'file'}): HTMLInputElement {
let input = document.createElement('input');
input.type = type;
// input.onchange = () => {
// // you can use this method to get file and perform respective operations
// let files = Array.from(input.files);
// console.log(files);
// };
input.click();
return input
}
}