No video

Fetching Data in Angular - Do It Correctly

  Рет қаралды 18,694

Monsterlessons Academy

Monsterlessons Academy

Күн бұрын

Пікірлер: 47
@MonsterlessonsAcademy
@MonsterlessonsAcademy 3 жыл бұрын
Watch next: Sharing Data Between Components Using Service in Angular - kzfaq.info/get/bejne/kKmPosaFprmoqKc.html
@trendytopics-
@trendytopics- 2 жыл бұрын
Very clear explanation, in short time, source code available, timestamps. A lot of helpful tutorials on this channel. THANK YOU SO MUCH FOR THIS! Subscribed!
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Glad it was helpful!
@daviddmellul1398
@daviddmellul1398 Ай бұрын
Hello , very clear explanation and tutorial. Will it work the same way in Angular 18 ? It seems that httpclient module obsolete . Any advice ? Thank you
@MonsterlessonsAcademy
@MonsterlessonsAcademy Ай бұрын
Hi, yes it will. We still use Httpclient service in Angular 18 to get data. The only difference that we provide it in appConfig as provideHttpClient()
@daviddmellul1398
@daviddmellul1398 Ай бұрын
Thanks , will try .
@americatoken3334
@americatoken3334 2 жыл бұрын
great explaination
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Thank you!
@AnasandAmmar
@AnasandAmmar 10 ай бұрын
Thanks for the video! I have a question, why you are not using fetch API? I have tried it, and it's working.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 10 ай бұрын
Fetch API is Javascript and is based on promises. Angular http is the core part of Angular and is based on Observables. I highly recommend you to stick to Angular approaches.
@artworknataly
@artworknataly 3 жыл бұрын
Thank you very much for your video.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 3 жыл бұрын
I'm happy that you like it!
@user-mz1yc2zn8v
@user-mz1yc2zn8v 10 ай бұрын
recently I can't use the type inside the subscription, why?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 10 ай бұрын
No idea. You need to debug it.
@HM_Milan
@HM_Milan 2 жыл бұрын
Thank you
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
You're welcome!
@amiga115
@amiga115 3 жыл бұрын
Thank you for the videos. I'm new to Angular and I think your teaching is very good. I have a question: you created the http variable in the constructor. What is the difference than creating it outside the constructor?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 3 жыл бұрын
I'm happy that you like my videos! It's not possible to create http variable outside or constructor arguments. It's a way how it is designed in Angular. Because it's not just "creating a variable". We inject dependency in our service or component.
@nipunachathuranga7493
@nipunachathuranga7493 3 жыл бұрын
Thanks Bro
@MonsterlessonsAcademy
@MonsterlessonsAcademy 3 жыл бұрын
Any time
@ananthakumarr537
@ananthakumarr537 2 жыл бұрын
Hi i have error No overload matches this call. Overload 1 of 3, '(observer?: Partial | undefined): Subscription', gave the following error. Type '(movies: Movie[]) => void' has no properties in common with type 'Partial'.
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Hi can you post your code?
@slowpoke1808
@slowpoke1808 Жыл бұрын
Hey, idk is this still actual, but will be useful for those who will face this problem in the future. Rxjs changed from version 5 to version 6, HttpClientModule introduced serialized JSON support. So you can use Generic, like '.get'
@studentlearninginformatic4097
@studentlearninginformatic4097 Жыл бұрын
wich app use for coding ?
@studentlearninginformatic4097
@studentlearninginformatic4097 Жыл бұрын
wich color theme?
@MonsterlessonsAcademy
@MonsterlessonsAcademy Жыл бұрын
It's gruvbox. Here is a video about an editor. kzfaq.info/get/bejne/j9h8nNiYqc6npZ8.html
@vamshi_travelling_life
@vamshi_travelling_life 2 жыл бұрын
Can we deploy angular app with json server Will json server api's work after deployment
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Yes sure. It's just a node process. Just run it like locally and it will work. But this is not a production solution of course.
@TheHcobain
@TheHcobain 2 жыл бұрын
Hello, thanks for the tutorial, is it possible to run json server on github pages somehow?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Hi unfortunately I didn't try that so I can't help
@vamshi_travelling_life
@vamshi_travelling_life 2 жыл бұрын
Can we deploy angular app with json server Will json server api's work after deployment Please reply if u have any idea
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 жыл бұрын
Yes sure. It's just a node process. Just run it like locally and it will work. But this is not a production solution of course.
@serhiitachuk
@serhiitachuk 4 жыл бұрын
Is it iTerm or default Mac OS terminal?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 4 жыл бұрын
Nope. And by the way I don't use Iterm anymore. As I don't need 90% of features that iterm2 has because of tmux I switched to alacritty which works much faster and easier to configure.
@serhiitachuk
@serhiitachuk 4 жыл бұрын
@@MonsterlessonsAcademy can u create a video about your setup?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 4 жыл бұрын
@@serhiitachuk Later for sure but now I'm trying to get more subscribers and I don't think that this video will be too popular.
@andrewkhar4615
@andrewkhar4615 3 ай бұрын
Спасибо. Но есть ли где на русском вещаешь?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 2 ай бұрын
Нет
@adelkedjour
@adelkedjour 3 жыл бұрын
Thanks a lot for this videos, just a feedback, I think you need just to speed up a bit when you talk because you are really speaking too slow where it makes me sleep. (Please don't understand me wrong)
@MonsterlessonsAcademy
@MonsterlessonsAcademy 3 жыл бұрын
Thanks for the feedback. I know about this problem but as English not my native language it's tricky. As a quick fix I can recommend watching my videos on 1.25x speed. People write that it's more comfortable.
@webinatic216
@webinatic216 3 жыл бұрын
@@MonsterlessonsAcademy I like the speed of your speech. I understand every word and can follow.
@SyahirahFaizal
@SyahirahFaizal 2 жыл бұрын
Hi I have an error here : Error: src/app/app.component.ts:19:18 - error TS2769: No overload matches this call. Overload 1 of 3, '(observer?: Partial | undefined): Subscription', gave the following error. Type '(users: UserInterface[]) => void' has no properties in common with type 'Partial'. Overload 2 of 3, '(next: (value: Object) => void): Subscription', gave the following error. Argument of type '(users: UserInterface[]) => void' is not assignable to parameter of type '(value: Object) => void'. Types of parameters 'users' and 'value' are incompatible. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? Type 'Object' is missing the following properties from type 'UserInterface[]': length, pop, push, concat, and 28 more. Overload 3 of 3, '(next?: ((value: Object) => void) | null | undefined, error?: ((error: any) => void) | null | undefined, complete?: (() => void) | null | undefined): Subscription', gave the following error. Argument of type '(users: UserInterface[]) => void' is not assignable to parameter of type '(value: Object) => void'. Types of parameters 'users' and 'value' are incompatible. Type 'Object' is not assignable to type 'UserInterface[]'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? 19 .subscribe((users: UserInterface[]) => { helpp :((
@ananthakumarr537
@ananthakumarr537 2 жыл бұрын
same error .. .u got answer ?
@adeshadhau643
@adeshadhau643 3 жыл бұрын
how to unit test json file data having multiple id's of users in angular ? user.json => [ { "id": "123", "email": "@sdafs.com", "isActive": "tru }, { "id": "234", "email": "@kjsdk.com", "isActive": false } ] specs.ts=> it("should be",()=>{ expect(???????).tobe(??????)}) I have used httpclient method as you are doing in this video,but I have to do unit testing of user data present in json file, can you help me ?
@MonsterlessonsAcademy
@MonsterlessonsAcademy 3 жыл бұрын
I can't answer it in several lines. Testing is quite a bit topic Here is a good article about how to mock and test httpClient blog.angulartraining.com/how-to-write-unit-tests-for-angular-code-that-uses-the-httpclient-429fa782eb15
Angular Services Explained - Sharing Data Between Components
19:25
Monsterlessons Academy
Рет қаралды 10 М.
Angular HTTP | From Basics to Advanced
37:08
Get Arrays
Рет қаралды 26 М.
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 5 МЛН
Ik Heb Aardbeien Gemaakt Van Kip🍓🐔😋
00:41
Cool Tool SHORTS Netherlands
Рет қаралды 9 МЛН
а ты любишь париться?
00:41
KATYA KLON LIFE
Рет қаралды 3,4 МЛН
Angular Parent Child Communication - Pass Your Data Correctly
16:16
Monsterlessons Academy
Рет қаралды 6 М.
Fetching Data in React - Complete Tutorial
29:10
Cosden Solutions
Рет қаралды 113 М.
Rxjs Streams in Angular - Normalizing Data (Map and Pipe Operator)
12:18
Monsterlessons Academy
Рет қаралды 27 М.
I only ever use *these* RxJS operators to code reactively
25:25
Joshua Morony
Рет қаралды 127 М.
Angular 15 CRUD app using material UI | JSON-server | step by step
1:26:26
Technical Babaji
Рет қаралды 293 М.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 265 М.
Angular HTTP Client Quick Start Tutorial
9:56
Fireship
Рет қаралды 194 М.
Top 5 Angular Mistakes - You Must Know Them
10:32
Monsterlessons Academy
Рет қаралды 58 М.
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 5 МЛН