Best practices for passing data between components in Angular - 3 Angular Tips

  Рет қаралды 6,451

NeverBenBetter

NeverBenBetter

Күн бұрын

More Angular tips and tricks in this video. Angular is a beast of a framework with an overwhelming amount of possibilities. For example, what is the best way to pass data between components in Angular? That is the question I address in this video. Along with it, I give two more tips to help improve the quality of your Angular code, your utility of TypeScript and your understanding of RXJS.
I feel like I went through several stages as I learned Angular.
Stage 1: Following tutorials and trying to find meaning.
Stage 2: Exploring and expanding upon tutorials.
Stage 3: Getting into the documentation, discovering advanced topics and becoming more consistent, organized, and efficient.
This video is for learners late in stage 2 or early into stage 3. It assumes familiarity with the following topics in RXJS:
How are Observables Different from Promises? | Beginner RXJS Lessons
• How are Observables Di...
RXJS Operators Explained with Examples: Switchmap, Map, + More
• RXJS Operators Explain...
CONTENTS
Literal Types and Literal Narrowing: 0:34
ReplaySubject and how it differs from other RxJS Subjects: 2:41
The best way to pass data between components in Angular: 6:11
My name is Ben and I am a software developer. I have iOS apps and a few web apps. (Every other web app is comparatively small and was developed using vanilla JavaScript.) If you'd like to see what I'm about or what I've done, check out the links below:
THE PERFECT BOARDGAME - A site for matching tabletop games with your unique preferences
theperfectboardgame.com
SOLUTIONS FOR X - My first published iOS apps
solutionsforx.com
NEVER BEN BETTER - My Blog
neverbenbetter.com
MY PATREON SITE:
www.patreon.com/neverbenbetter
MY GEAR
Sony ZV 1
amzn.to/2DXxrRV
Fifine Condenser Recording Microphone
amzn.to/2E7bboc

Пікірлер: 26
@abhisheksitar
@abhisheksitar 3 жыл бұрын
Great tutorial. You have a knack of explaining difficult concepts
@neverbenbetter8225
@neverbenbetter8225 3 жыл бұрын
Hey, thank you so much!
@rickwhitehead4356
@rickwhitehead4356 2 жыл бұрын
You have what comes across as a very natural ability, and great analogies, for explaining these very useful, but often confusing, technical topics. I've found myself coming back to your videos repeatedly (share-replay). I know 'I'd appreciate some minimal, but end-to-end, code examples to refer to (e.g. a service to store (and share) selected state across components: view/edit/navigation/breadcrumb etc), but appreciate the time required to produce something like that. Clearly you are the perfect person to be building an LMS! - A natural teacher.
@fatimazboujrar
@fatimazboujrar 15 күн бұрын
thank you for the amazing videos
@nerdiloo9863
@nerdiloo9863 3 жыл бұрын
Veeerryyy interesting about the replay subject approach - I'm gonna give it try - thanks man 👍 Update : It worked! Big thanks NBB
@otmanm4095
@otmanm4095 2 жыл бұрын
Pure gold !
@mahdiandalib186
@mahdiandalib186 5 ай бұрын
thx man, plz create more angular tutorials
@rembautimes8808
@rembautimes8808 2 жыл бұрын
It’s difficult to find clear concise tutorials that illustrate the strength of the Angular platform. Yours is one of the few ones to do so in 11 mins.
@neverbenbetter8225
@neverbenbetter8225 2 жыл бұрын
Wow, what a compliment! Thank you!
@hernanvelazquez1421
@hernanvelazquez1421 2 жыл бұрын
Nice, thanks. If you share a repo with the code for each video that would be great to take a closer look.
@Semma_Bore
@Semma_Bore 3 жыл бұрын
Well explained...👍
@neverbenbetter8225
@neverbenbetter8225 3 жыл бұрын
hari prasad thank you so much! Sometimes I worry I’ll receive criticism for over simplifying. Got to find the right balance.
@kjmoses8546
@kjmoses8546 2 жыл бұрын
I like literally everything u do .. And what microphone and camera name u use ..
@hanmingzheng5592
@hanmingzheng5592 2 жыл бұрын
Would be good if you can just call it union type since that's the official term
@blexyt3485
@blexyt3485 3 жыл бұрын
Hello @NeverBenBetter, Do you teach full online video course to Angular? If YES, it would be great. If NO, can you pls make some depth video online!?
@neverbenbetter8225
@neverbenbetter8225 3 жыл бұрын
I don’t, but I’ve returning from a bit of a break and I’m the time I’ve been gone, my programming videos have gathered a lot of attention. I’m going to make some RXJS videos in response to many comments and we’ll see if that leads into an Angular course.
@blexyt3485
@blexyt3485 3 жыл бұрын
Thanks
@hanmingzheng5592
@hanmingzheng5592 2 жыл бұрын
Just wondering if we use ReplaySubject with a type of Book[] as the generics, does it automatically add null or undefined to it? Regardless whether it does or not, I don't think Replay is a lot better than Behavior subject. Because it forces the users to be aware of the type. If it can never be null then instantiate with empty array. If we instantiate with null then we have to include null. For for ReplaySubject, we don't know. If it always add null to the type then we always have to handle that throughout our code base. If it does not atuo add null to the type then we are likely to get our favorite null pointer. So base on what is discribed in the vid, I don't think we should use ReplaySubject. If possible, stick to BehaviorSubject, yes we might need to instantiate with null but so what, the benefit is a much safer application.
@ricko13
@ricko13 3 жыл бұрын
this is why im moving to React.js
@code-coaching
@code-coaching 3 жыл бұрын
Let us think about another option than var.
@neverbenbetter8225
@neverbenbetter8225 3 жыл бұрын
Sure. Here’s an exercise. What can I use to replace “var” in this sentence? “I wrote a varter about when I drove a Chevrovarte to go outvar shopping.” 😜
@akilmontrope2431
@akilmontrope2431 3 жыл бұрын
You could use 'let' from ES6 right?
@neverbenbetter8225
@neverbenbetter8225 3 жыл бұрын
Akil Montrope Yes. When you said “let” us think about... I thought you were making a joke. In seriousness, let can also be used and it was an error to not mention it as an appropriate option. www.typescriptlang.org/docs/handbook/release-notes/typescript-1-4.html#let-declarations
@code-coaching
@code-coaching 3 жыл бұрын
@@neverbenbetter8225 It was a joke, but not by Akil!
@Almighty_Flat_Earth
@Almighty_Flat_Earth 2 жыл бұрын
10:19 where do these functions get called from? When do they get called? this.doOnChange() and this.whenSynched()
@kjmoses8546
@kjmoses8546 2 жыл бұрын
I like literally everything u do .. And what microphone and camera name u use ..
AngularFire - WHAT YOU MUST KNOW TO GET STARTED WITH CLOUD FIRESTORE
7:22
5 Tips for Using Angular More Efficiently
20:04
NeverBenBetter
Рет қаралды 22 М.
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 51 МЛН
Spot The Fake Animal For $10,000
00:40
MrBeast
Рет қаралды 186 МЛН
RXJS Real Examples - 1.  How to Use Observables to Manage User Data
23:02
Sharing Data between Components in Angular
5:19
Fireship
Рет қаралды 492 М.
Why Firebase? HOW to determine whether YOU should use FIREBASE
8:29
Why use OnPush in Angular? Not for performance...
13:15
Joshua Morony
Рет қаралды 31 М.
These ARE the Angular tips you are looking for | John Papa
25:05
RXJS Operators Explained with Examples: switchMap, map + More
9:07
NeverBenBetter
Рет қаралды 29 М.
How are Observables Different from Promises? | Beginner RXJS Lessons
8:46
Complex features made easy with RxJS
36:13
Hasgeek TV
Рет қаралды 59 М.
Top 5 Angular Mistakes - You Must Know Them
10:32
Monsterlessons Academy
Рет қаралды 57 М.
Error Handling in Angular - Complete Guide (2022)
41:27
Decoded Frontend
Рет қаралды 65 М.