This is why you need TypeScript type guards in Angular
Channel:
Subscribers:
81,900
Published on ● Video Link: https://www.youtube.com/watch?v=1rgr8Ip_cfE
We take a look at four different approaches to dealing with potentially null values in Angular, ending in creating a generic type guard that we can use to assign a type to any object on the condition that it has no null values.
Get weekly content and tips exclusive to my newsletter: https://mobirony.ck.page/4a331b9076
Learn Angular with Ionic: https://ionicstart.com
0:00 Introduction
0:15 The problem
1:01 Type assertion
1:45 Manual check
2:31 Type guard
4:23 Generic type guard
#ionic #angular
- More tutorials: https://eliteionic.com
- Follow me on Twitter: https://twitter.com/joshuamorony
Other Videos By Joshua Morony
Tags:
ionic
tutorial
tutorials
ionic tutorials
ionic framework
coding
coding tutorials
angular
angular tutorials
capacitor tutorials
mobile
mobile apps
apps
html5
ios
android
native
hybrid
pwa
web apps
progressive web applications
programming
stenciljs
stencil
performance
ui
ux
animations
screencast
rxjs
nx
ngrx
architecture