Fireship · @fireship
Advanced Angular Elements
Uploaded December 6, 2018 · Length 11:46
Summary
advanced angular elements techniques for building web applications with web components, lazy loading images, and optimizing performance with angular and firebase.
- angular elements
- web components
- lazy loading
- performance optimization
- angular and firebase
- custom elements
- shadow dom
- change detection
- web development
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
[Music]
- 0:06
one of the most exciting trends
- 0:08
happening in web development is the
- 0:09
adoption of web components because they
- 0:11
allow us to build applications that
- 0:13
don't walk us in to a specific framework
- 0:14
or a programming style I'm going to be
- 0:16
using web components in production very
- 0:18
soon so I wanted to share some advanced
- 0:19
concepts that I've learned working with
- 0:21
angular elements and I'll even show you
- 0:23
how to achieve a near perfect white
- 0:24
house performance score with the full
- 0:25
power of angular and firebase in your
- 0:27
Java Script bundle if you're new here
- 0:29
like and subscribe and congrats to
- 0:31
Damian right who's last week's t-shirt
- 0:32
winner but don't worry if you missed out
- 0:34
there's another one of a kind t-shirt
- 0:35
going out this week all you have to do
- 0:36
is leave a comment below over the last
- 0:39
few months I've been building a product
- 0:40
called fire ship IO which is just a
- 0:42
better way for me to deliver my content
- 0:44
to you this project needs to be very
- 0:46
fast in search engine optimized but it
- 0:48
also needs to use firebase for user
- 0:49
authentication and dynamic data the
- 0:52
beauty of web components is that I can
- 0:53
pre render all of my static content and
- 0:55
then bootstrap in custom elements when
- 0:57
they're needed throughout this journey
- 0:58
I've used pretty much every web
- 1:00
component tool that's out there and I
- 1:01
found that angular elements is the most
- 1:03
productive for a larger project but
- 1:05
you'll also want to check out stencil
- 1:06
and lit element which I think are both
- 1:07
very promising
- 1:08
the big advantage of elements is that a
- 1:10
you get the full power of angular and B
- 1:12
your components can share the same
- 1:13
dependency injector tree which means you
- 1:15
can easily share data or functionality
- 1:17
between your custom elements and see the
- 1:19
API is stable and being used in
- 1:20
production at Google today we're going
- 1:22
to build a custom element that can lazy
- 1:24
load an image based on the user scroll
- 1:26
position in the browser when the image
- 1:28
is loading it will show this Facebook
- 1:30
style shimmer placeholder then replace
- 1:32
it with the image when it's fully loaded
- 1:33
now we'll jump into some code but if you
- 1:35
haven't already seen my original angular
- 1:36
elements video you'll want to check that
- 1:37
one out which is a little more basic
- 1:39
level the first thing I want to do is go
- 1:41
into your angular app and then run ng
- 1:43
add at angular elements this will
- 1:45
install the dependencies and also add
- 1:47
the polyfills to ensure that your
- 1:48
elements are compatible with all
- 1:50
browsers then you can go into the app
- 1:52
directory and you'll want to just go
- 1:53
ahead and delete everything except for
- 1:55
the app module you'll also notice I've
- 1:57
generated a couple of regular components
- 1:59
in here as well the first thing I want


