Top 5 Angular Mistakes - You Must Know Them

preview_player
Показать описание
Learn top 5 Angular mistakes in 10 minutes. Here I want to share 5 most common Angular mistakes that people do. If you avoid this mistakes you can code faster, be more productive and achieve your goals.

FOLLOW ME

RECOMMENDED VIDEOS

MY COURSES

Disclosures: All opinions are my own. Sponsors are acknowledged. Some links in the description are affiliate links that if you click on one of the product links, I’ll receive a commission at no additional cost to you.
Рекомендации по теме
Комментарии
Автор

0:10 Subscribe Instead of Streams
4:26 Unsubscribe
5:33 Not Enough TypeScript
6:47 God Object Modules
7:49 Performance: TrackBy

starlite
Автор

Have watched several videos with this Author (name?). This is something real high quality. I am an experienced programmer and have even worked with Angular for some time and still this was very much worth watching. He has a God given talent of making coding videos.
This series should have 1000s of likes.. really amazing well explained . Very well edited everything is not too long and not too short.. It is a real pleasure to watch and learn from. Also by following these videos you pick up good coding practices with an understanding of why!

d.bachmann
Автор

I'm coming from a React background and now am starting to learn Angular and I most say these subscription feel unnecessary to use everywhere. They are very useful when data gets updated again and again like a stream. But when I just want to fetch a single value from the api.. why do I need to subscribe to it. A promise is all I need. I turned to using the firstvaluefrom from rxjs in the service and turning the requesting method in the component into a async method. Now I can utilize async/await and try catch blocks . I don't know if it's wrong, the reason "it is the angular way" is not really an answer. Angular has changed it ways allot with every update.

MrMaxxx
Автор

About the first point: the use of streams and async-pipe is really nice - UNTIL you realize that there is a thing called "error handling"! It's save to save that you want some sort of error handling in every single async call - at the very least this will reset your "loading"-indicator (like a spinner), but it might also display proper messages to the user.

This is were async gets ugly - very badly so - you need a second stream, operators to share the original subscription and so on. You CAN do it, but in the end it does get quite bloated. Please show the ugly parts as well when recomending async-pipes.

Other than that: nice video!

Matrium
Автор

For the second problem: you don't need unsubscribe subscription from http client requests. These are single subscription and are cleaned up by the http client itself.

mapiideal
Автор

It's a good tips. Oleksandr, I have a question to you: why do we initialize our values ​​in the constructor and not in the lifecycle hook OnInit? Because ngOnInit was created just for this. Isn't it bad code style to push variable initialization into a constructor?

yevhen
Автор

Thanks for pointing the common mistakes and giving detailed solutions for each of them, helped me a lot! Subscribed

abhisheksaxena
Автор

Wow, been coding Angular for 2 years and I’ve been doing it all wrong. 😅 thanks for making this video!

dinysanchez
Автор

Thanks. These are the mistakes I've been doing for the last 4 months since when I started writing Angular code.

yanmoenaing
Автор

Thanks, this video helped me understand the angular design pattern better.

rajtilak
Автор

Using the async pipe method how would you handle errors? Maybe my question is too broad and requires its own tutorial which would be very welcome. Thanks for the video

joeyvico
Автор

Thanks for these helpful tips, what if I used track by index instead of creating function inside component?

shivajimore
Автор

Wow! This is really helpful 👌, thanks for sharing. I'm guilty of subscribe instead of stream, I can only use it effectively when I want to fetch data, but how do I use streams for updating, deleting and creating data or generally CRUD operations? Thanks

ugochukwuumerie
Автор

Is it necessary to declare the observable in the constructor? I have always declared it in the ngOninit. What's the benefit ?

domenicocucinotta
Автор

thanks for your videos
when we use stream instead of subscribe what if we need to make loading or error happened how to handle this

mahmoudmohamed-xulb
Автор

Regarding first example with async pipe, what if you want to display a loading spinner while data is being fetched? how you do that with no subscriptions in an easy way (without using interceptors)?

nickparana
Автор

Nice, a newly found Angular content creator 🤩 (or at least partly). Will sub an see if you'll continue putting out advanced Angular tutorials. Looking forward!

mikhailratner
Автор

Great content. Earned yourself a subscriber.

Just a bit skeptical about the shared module cause even Angular recommends it.

g-luu
Автор

thanks a lot for your videos, easy to understand straight to the point. I'm transitioning from react, they helped a lot!

ghkpr
Автор

cool video mate, i havent used the trackby function!

Thon-Diego