Fireship · @fireship
AngularFire2 Storage - File Upload Dropzone
Uploaded January 26, 2018 · Length 11:18
Summary
angularfire2 storage file upload dropzone tutorial
- angularfire2 storage
- file upload
- dropzone
- angular directive
- firebase storage
- angular tutorial
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
[Music]
- 0:01
fire base storage is now officially
- 0:04
supported by angularfire 2 which means
- 0:06
uploading files from an angular
- 0:08
application is easier than ever before
- 0:10
in this episode I'm going to take you
- 0:12
through the new features in the
- 0:13
angularfire 2 storage module then we'll
- 0:16
use it to build a drop zone file
- 0:18
uploader from scratch in addition to
- 0:20
uploading files to firebase storage it
- 0:22
can also control the entire upload
- 0:24
process by pausing canceling or resuming
- 0:27
an upload
- 0:28
there's a whole bunch of other cool
- 0:29
stuff I want to show you but first make
- 0:31
sure to LIKE and subscribe and grab the
- 0:33
source code from angular firebase com
- 0:36
before we jump into the code I want to
- 0:38
give you a few more details about how
- 0:39
the angularfire 2 storage module works
- 0:42
when we drag and drop a file it's going
- 0:44
to start an angular fire upload task
- 0:46
which will immediately start uploading
- 0:48
the file to your firebase storage bucket
- 0:50
you can then monitor the upload progress
- 0:52
as an observable the snapshot is emitted
- 0:55
several times per second so you can do
- 0:57
things like update your progress bar or
- 0:59
just provide the user with some helpful
- 1:00
feedback when the process is complete it
- 1:03
will give you back the download URL that
- 1:05
you can show in your front-end UI now
- 1:07
let's go ahead and build this thing
- 1:08
we'll start with a brand new angular 5
- 1:10
app and then inside that project install
- 1:12
angularfire 2 and firebase then inside
- 1:15
of your angular environment add your
- 1:17
firebase project config and lastly we'll
- 1:20
go into the app module and initialize
- 1:22
our angular fire app I am bringing in
- 1:25
both the angular fire storage module and
- 1:27
the fire store database for some
- 1:29
advanced stuff I'll show you towards the
- 1:30
end of the video now that we have
- 1:32
angular fire to set up we need a way to
- 1:33
retrieve a file from the user's device
- 1:35
into our angular app we want the user to
- 1:38
drag and drop a file which is a perfect
- 1:40
use case for an angular directive we
- 1:43
want to use this directive on an HTML
- 1:45
element and have it emit custom events
- 1:48
based on certain drag-and-drop activity
- 1:50
we can create custom events an angular
- 1:52
by using a combination of host listener
- 1:54
output and event emitter the first thing
- 1:58
we do is create our custom events which


