Angular Services Explained - Sharing Data Between Components

Angular Services Explained - Sharing Data Between Components

Monsterlessons Academy

3 года назад

9,811 Просмотров

In this video you will learn about sharing data between components using service in Angular. We can of course just write our API call inside component but then we can't really reuse this code because it's coupled with a component. Services in Angular help us to share data between different components in an easy and dry way.

🚨IMPORTANT:
→ Advanced Angular course: https://monsterlessons-academy.com/p/angular-and-ngrx-building-real-project-from-scratch
→ All my courses: https://monsterlessons-academy.com/courses
→ Twitter: https://twitter.com/monster_lessons

🕛 TIMESTAMPS:
0:00 Introduction
2:47 Creating Angular service
18:08 Sharing Data Between Components Using Service
18:29 Call to action

📚 References:
→ Angular for beginners - Full Playlist: https://www.youtube.com/playlist?list=PLEjh-YiSBCDLC_zhXQ2J5SkHrLHdmV8qc
→ Source code :https://github.com/monsterlessonsacademy/monsterlessonsacademy/tree/services-in-angular

Тэги:

#monsterlessons_academy #angular_services_http #angular_sharing_data_between_components #angular_sharing_data_between_components_using_service #data_sharing_between_two_components_in_angular #sharing_data_between_components_using_service #sharing_data_between_components_using_service_angular #creating_angular_service #angular #angular_2 #angular_fetch #angular_http_client #angular_component_communication #angular_services
Ссылки и html тэги не поддерживаются


Комментарии:

Kishkin Joshi
Kishkin Joshi - 20.12.2021 12:29

I am working on an angular project where , I have defined a function to call an get api in component 1 and I want to call this function in component 2 using a service . Can you suggest me how to do it??

Ответить
JustCoder
JustCoder - 18.08.2021 21:49

I managed to get everything working this time and I spotted what I had done wrong in the previous one.

I your full angular course do you effectively build a MEAN stack (or any other DB) or is it kept solely to the front end? Thanks

Ответить