• Stars
    star
    192
  • Rank 195,148 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔌 A handy FilePond adapter component for Angular

Angular FilePond

Angular FilePond is a handy adapter component for FilePond, a JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience.

License: MIT npm version npm npm peer dependency version


FilePond

Buy me a Coffee / Use FilePond with Pintura / Dev updates on Twitter


Core Features

  • Accepts directories, files, blobs, local URLs, remote URLs and Data URIs.
  • Drop files, select on filesystem, copy and paste files, or add files using the API.
  • Async uploading with AJAX, or encode files as base64 data and send along form post.
  • Accessible, tested with AT software like VoiceOver and JAWS, navigable by Keyboard.
  • Image optimization, automatic image resizing, cropping, and fixes EXIF orientation.
  • Responsive, automatically scales to available space, is functional on both mobile and desktop devices.

Learn more about FilePond


Also need Image Editing?

Pintura the modern JavaScript Image Editor is what you're looking for. Pintura supports setting crop aspect ratios, resizing, rotating, cropping, and flipping images. Above all, it integrates beautifully with FilePond.

Learn more about Pintura

Installation

Install FilePond component from npm.

npm install filepond ngx-filepond --save

Import FilePondModule and if needed register any plugins. Please note that plugins need to be installed from npm separately.

Add FilePond styles path ./node_modules/filepond/dist/filepond.min.css to the build.options.styles property in angular.json

Setting up FilePond with Angular 13

// app.module.ts
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { AppComponent } from "./app.component";

// import filepond module
import { FilePondModule, registerPlugin } from "ngx-filepond";

// import and register filepond file type validation plugin
import FilePondPluginFileValidateType from "filepond-plugin-file-validate-type";

registerPlugin(FilePondPluginFileValidateType);

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    FilePondModule, // add filepond module here
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}
<!-- app.component.html -->
<file-pond
  #myPond
  [options]="pondOptions"
  [files]="pondFiles"
  (oninit)="pondHandleInit()"
  (onaddfile)="pondHandleAddFile($event)"
  (onactivatefile)="pondHandleActivateFile($event)"
>
</file-pond>
// app.component.ts
import { Component, ViewChild } from "@angular/core";
import { FilePondComponent } from "ngx-filepond";
import { FilePondOptions } from "filepond";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"],
})
export class AppComponent {
  @ViewChild("myPond") myPond: FilePondComponent;

  pondOptions: FilePondOptions = {
    allowMultiple: true,
    labelIdle: "Drop files here...",
  };

  pondFiles: FilePondOptions["files"] = [
    {
      source: "assets/photo.jpeg",
      options: {
        type: "local",
      },
    },
  ];

  pondHandleInit() {
    console.log("FilePond has initialised", this.myPond);
  }

  pondHandleAddFile(event: any) {
    console.log("A file was added", event);
  }

  pondHandleActivateFile(event: any) {
    console.log("A file was activated", event);
  }
}

How to run project

Run npm run packagr to generate package in dist.

Run npm pack in dist folder to generate .tgz file.

Run npm install in project folder.

How to fix import errors

If you get a "types/index" has no default export error, you can either rewrite the import:

import * as FilePondPluginFileValidateType from "filepond-plugin-file-validate-type";

Or add these 2 lines to your tsconfig.json file:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true
  }
}

Read the docs for more information

More Repositories

1

filepond

🌊 A flexible and fun JavaScript file upload library
JavaScript
14,568
star
2

vue-filepond

🔌 A handy FilePond adapter component for Vue
JavaScript
1,875
star
3

react-filepond

🔌 A handy FilePond adapter component for React
JavaScript
1,757
star
4

flip

⏳ The online version of the classic flip clock
JavaScript
834
star
5

svelte-filepond

🔌 A handy FilePond adapter component for Svelte
JavaScript
233
star
6

jquery-filepond

🔌 A handy FilePond wrapper for jQuery
JavaScript
219
star
7

tick

⏱ A counter component to render different countdown styles with
JavaScript
80
star
8

filepond-boilerplate-php

🔥 A FilePond PHP project starter kit
HTML
64
star
9

angular-filepond

🔌 A handy FilePond adapter component for Angular
TypeScript
58
star
10

filepond-server-php

A PHP server that handles FilePond uploads
PHP
48
star
11

filepond-plugin-image-preview

🖼 Show a preview for images dropped on FilePond
JavaScript
44
star
12

snaptext

Snap a picture of HTML text
JavaScript
42
star
13

filepond-plugin-file-validate-type

🚦 File Type Validation plugin for FilePond
JavaScript
33
star
14

filepond-plugin-image-edit

✂️ Link image editor to allow editing of images dropped on FilePond
JavaScript
24
star
15

filepond-plugin-image-transform

🖼 Client-side image transformations for FilePond
JavaScript
19
star
16

filepond-plugin-file-validate-size

🚦 File Size Validation plugin for FilePond
JavaScript
17
star
17

pintura-example-javascript

HTML
14
star
18

filepond-plugin-file-encode

🗜 Send FilePond Files Along with Form Submit
JavaScript
13
star
19

doka-php

PHP files to handle apply FilePond and Doka formatted image resize and crop information to files
PHP
13
star
20

filepond-polyfill

🔨 Use FilePond on Older Browsers
JavaScript
9
star
21

filepond-plugin-file-poster

🖼 Add a poster image to files
JavaScript
9
star
22

snippy

🍡 Quickly create your own custom shortcodes
PHP
9
star
23

11ty-tablissimo

JavaScript
9
star
24

filepond-plugin-image-exif-orientation

🖼 Extract EXIF orientation information from images dropped on FilePond
JavaScript
8
star
25

filepond-plugin-image-crop

🖼 Add image crop instructions to files dropped on FilePond
JavaScript
8
star
26

filepond-plugin-image-resize

🖼 Add image resize instructions to files dropped on FilePond
JavaScript
8
star
27

filepond-plugin-image-validate-size

🚦 Image Size Validation plugin for FilePond
JavaScript
8
star
28

hud

A visual way to debug 2D data
JavaScript
6
star
29

filepond-plugin-file-rename

🏷 File rename plugin for FilePond
JavaScript
6
star
30

tick-view-boom

A freely available audio plugin for Tick Counter
JavaScript
6
star
31

filepond-plugin-image-filter

🖼 Add a Color Matrix filter to images
JavaScript
5
star
32

pintura-example-react

JavaScript
5
star
33

filepond-plugin-file-metadata

🏷 File metadata plugin for FilePond
JavaScript
5
star
34

pintura-example-nextjs

JavaScript
4
star
35

pintura-example-jquery

HTML
4
star
36

pintura-example-vue-3

Vue
3
star
37

pintura-media-kit

Pintura media for third-parties
3
star
38

tablissimo

JavaScript
3
star
39

pintura-example-react-typescript

TypeScript
3
star
40

pintura-example-react-native-expo

JavaScript
2
star
41

pintura-example-cordova

JavaScript
2
star
42

pintura-example-photo-editor

HTML
2
star
43

pintura-example-react-native

Java
2
star
44

pintura-component-react-native-expo

HTML
1
star
45

filepond-plugin-image-editor

TypeScript
1
star
46

pintura-example-feature-retouch

JavaScript
1
star
47

pintura-example-vue-2

Vue
1
star
48

pintura-example-sveltekit

Svelte
1
star
49

filepond-github-assets

Assets used on FilePond GitHub repository
1
star
50

pintura-example-jquery-file-upload

HTML
1
star
51

pintura-component-react-native

HTML
1
star