Import
import { NuiDropzone, type NuiUploader } from '@needless-ui/angular/dropzone';NuiDropzone
A place to drop files, or choose them.
| Name | Type | Default | Description |
|---|---|---|---|
filesTwo-way | File[] | [] | The files it holds, in order. |
acceptInput | string | The kinds of file it takes, as for <input type="file">. | |
multipleInput | boolean | true | More than one file at a time. |
directoryInput | boolean | false | Offers a button to choose a folder. |
maxFilesInput | number | Infinity | How many files it holds. |
maxSize, minSizeInput | number (bytes) | The largest and smallest file, in bytes. | |
validateInput | (file: File) => string | null | Checks each file. A message turns it away. | |
uploadInput | NuiUploader<R> | Sends a file. Without it, files are only held. | |
concurrencyInput | number | 3 | How many files upload at once. |
hintInput | string | A line under the zone’s text, such as what it takes. | |
disabledInput | boolean | false | It takes no files. |
labelsInput | Partial<NuiDropzoneLabels> | Every text it shows or announces, to translate. | |
uploadedOutput | NuiUpload<R> | Emits a file uploaded, with what upload returned. | |
rejectedOutput | { file, reason }[] | Emits the files turned away, with the reasons. | |
queueProperty | NuiUploadQueue<R> | The upload queue, to cancel, retry and read progress from code. | |
takeMethod | (files: Iterable<File>) => void | Adds files from code, checking each one. |
NuiUploader
Sends one file: it reports progress from 0 to 1, and stops when the signal aborts.
| Name | Type | Default | Description |
|---|---|---|---|
(file, context)Method | (file: File, { signal, progress }) => Promise<R> | Returns a promise of whatever your server answers. |