Angular 4/5 HTTP GET and POST requests tutorial

  Рет қаралды 178,779

techsith

techsith

Күн бұрын

Пікірлер: 343
@ericaepperson8928
@ericaepperson8928 6 жыл бұрын
thank you for your down-to-earth teaching style. So nice to listen to you chat about coding without the inflated ego that so many people in the tech world seem to think is requisite to being a successful programmer. I really enjoy your videos, thank you!
@Techsithtube
@Techsithtube 6 жыл бұрын
Thank you for watching. I believe that as a teacher you need to be humble.
@architadesai7876
@architadesai7876 6 жыл бұрын
There was a time when I had no hope to finish my task on the edge and then your video came and you're such a savior! No other videos explained it like this.
@Techsithtube
@Techsithtube 6 жыл бұрын
Archita, I am glad that you were able to fine what you were looking for. :)
@iily.official
@iily.official 6 жыл бұрын
@@Techsithtube it's sad that you didn't do the Post request example into the input area :(
@nzjemountfort
@nzjemountfort 7 жыл бұрын
Excellent Tutorial - in the first minute you pointed out some issues that took me a long time to even identify a while ago, that will help save ALOT OF PEOPLE ALOT OF TIME!
@Techsithtube
@Techsithtube 7 жыл бұрын
I did suffer from the same when i started and I thought its important for people to know. Thanks for watching!
@mukeshvaidya1379
@mukeshvaidya1379 6 жыл бұрын
you have very pleasing way to present the topic in simple and lucid manner which made me comment .Looking forward for more in Angular God Bless!
@somesbhowmick2082
@somesbhowmick2082 7 жыл бұрын
Great component and as expected, full of necessary materiel related to "HttpService and CORS". You make complex thing simple and represented it nicely, Thanks
@Techsithtube
@Techsithtube 7 жыл бұрын
Somes, I am glad that it helped. I went through lot of trouble understanding it when i was learning so I thought it should be simpler than what others have been teaching.
@donnacampbell9187
@donnacampbell9187 6 жыл бұрын
Thank you so much...I am doing an Angular final in school and you have so helped me understand this !!Bless you!
@MrNagamalli
@MrNagamalli 7 жыл бұрын
Hi, your online session presentation is awesome.
@davidconnelly
@davidconnelly 6 жыл бұрын
Another great video (and thanks for answering my question, previously). You are knocking this out of the park. I just can't understand why you're doing all this for free. Anyway, thanks again for this. You're brilliant.
@Techsithtube
@Techsithtube 6 жыл бұрын
Thanks David for the kind words. Actually I had started creating a udemy course on Angular, I was half way through and someone stole my computer from my car so I lost all the work . I decided that I am going to keep it free to the world . May be one day I can create udemy course.
@harshu1982
@harshu1982 7 жыл бұрын
Thanks mate, I understood your tutorials very easily...have had been following many, but this helped me a lot actually.
@manueldiera6781
@manueldiera6781 6 жыл бұрын
This was great, you have a great way of explaining things and actually showed how to do this step by step. Thanks!
@jezzyfizzo
@jezzyfizzo 6 жыл бұрын
All your videos including the JavaScript ones are great. Thanks for the help!
@maynorsonglara
@maynorsonglara 5 жыл бұрын
Well done tutorial, very explanatory, really amazing edition cutting the unnecessary typing time. Congrats!
@dollardreams5811
@dollardreams5811 6 жыл бұрын
Hi techsith your tutorial is very informative plz upload full series on angular6 it's very helpful
@abhig3871
@abhig3871 6 жыл бұрын
Cool stuff TechSith, liked the get & Post requests
@iily.official
@iily.official 6 жыл бұрын
it's sad that you didn't do the Post request example into the input area :(
@mahevstark9950
@mahevstark9950 7 жыл бұрын
love you, thanks, bundle of thanks. you should know it only you're (very) public who is working with angular 5 :) even angular.io doesn't have such guides.
@Techsithtube
@Techsithtube 7 жыл бұрын
Thanks Faisal, ANgular documentation is confusing that is why i am creating these tutorials make more sense.
@bohdanartemenko
@bohdanartemenko 7 жыл бұрын
Oh my god thank you, i tried to find about how to fix that cross-origin for a long time, only this video tutorial helped me :)
@Techsithtube
@Techsithtube 7 жыл бұрын
Initially i struggled a lot on CORS issue and i could not find a good solution anywhere . So i understand your frustration. I am glad I could help. :)
@himanshuupreti9457
@himanshuupreti9457 6 жыл бұрын
Jsonp is the answer for CORS..
@gondrajkumar8783
@gondrajkumar8783 6 жыл бұрын
thank you so much...today i learn new and first time ..........it possible for this tutorial. it great teaching .....
@abinmathew7708
@abinmathew7708 6 жыл бұрын
Small and beautiful tutorial for a beginner
@akai2112123
@akai2112123 6 жыл бұрын
Thank you so much for the interceptor module ! Loved the video . Cheers
@manojkumarganigapeta2966
@manojkumarganigapeta2966 6 жыл бұрын
Nice sir I have one doubt like if I write service call in service.ts how can I get data to my component using post method
@Techsithtube
@Techsithtube 6 жыл бұрын
You can inject the service in your component
@Techsithtube
@Techsithtube 6 жыл бұрын
I have service tutotial you can check it out.
@tilakbarthi2183
@tilakbarthi2183 6 жыл бұрын
can u please tell me search with two input fields one is drop down one is input box taking request from json and display it in list model example i need
@Techsithtube
@Techsithtube 6 жыл бұрын
can you tell me little bit more about exactly what you need.
@pamidichetan
@pamidichetan 5 жыл бұрын
Inside services making a post request as below but the post request is not sent return this.http.post(this.rootUrl+'auth/sign_in',{ email : userName, password : password }) .map((data : any)=>{ localStorage.setItem('userToken',data.access_token); this.router.navigate(['/home']); }, (err : HttpErrorResponse)=>{ this.isLoginError = true; }); } Checked in the network also but there is no post request?
@Techsithtube
@Techsithtube 5 жыл бұрын
the code looks fine. Any errors?
@pamidichetan
@pamidichetan 5 жыл бұрын
@@Techsithtube no errors but I am doing call to the function from component to the service
@shivakumar3955
@shivakumar3955 7 жыл бұрын
Nice videos.Request you to please add more questions on Angular 2
@heberfomin
@heberfomin 6 жыл бұрын
Hi techsith. I have an issue. In dev environment I can send data to API. Api receives the Content-Type "application/x-www-form-urlencoded" that sends the json data to API, but, in production environment (after build) the API receives an empty json. My application is served by IIS. Do you have an idea how can I fix it? Is a web.config issue? Thanks.
@Techsithtube
@Techsithtube 6 жыл бұрын
Where are you using the prod version? It could be CORS issue. Is there any errors?
@heberfomin
@heberfomin 6 жыл бұрын
techsith, thanks for your kindness in to respond. Angular is in one server, API in another with different IP and https prefix (www and api.). There is no error message, but I agree with you is a Cors Issue. I Tried to resolve it on server thru web.config (IIS) with no success. The API is in Laravel and I put CORS module there, but did'n resolve also.
@ishankotru7652
@ishankotru7652 6 жыл бұрын
I have already build Rest Webservice application which is printing data in json. I want to build a service to fetch data from dat app and show in ng ui. plz help
@Techsithtube
@Techsithtube 6 жыл бұрын
You can sue this video to that. all you have to change it the api url .
@ishankotru7652
@ishankotru7652 6 жыл бұрын
@@Techsithtube let me try
@krishnanshankarasubramania3883
@krishnanshankarasubramania3883 6 жыл бұрын
Good one. Useful. One question: if we have multiple HttpClient url to get or post how to handle the access control allow origin? Is it possible to pass multiple URL in the interceptor?
@thebiography6021
@thebiography6021 7 жыл бұрын
Hi,I would like to know how to implement native plugins eg;camera in angular mobile app.
@Techsithtube
@Techsithtube 7 жыл бұрын
What platform you are using for building the mobile app?
@thebiography6021
@thebiography6021 7 жыл бұрын
ionic 3 ,which platform will be suitable with angular 5?
@Techsithtube
@Techsithtube 7 жыл бұрын
ionic 3 is sutable platform. I belive you can use Ionic Native to interface with the Cordova Camera plugin
@thebiography6021
@thebiography6021 7 жыл бұрын
Thanks you sir.
@nirajdewangan3508
@nirajdewangan3508 7 жыл бұрын
thank you, for such a great tutorial.. I am beginner to angular and this series is helping me lot
@Techsithtube
@Techsithtube 7 жыл бұрын
Thanks for watching!
@ashishrprastogi
@ashishrprastogi 5 жыл бұрын
Hi Sir, I need your help. I got one API which is working on postman but when I have tried to call though angular code it is not working.. showing error
@tayyabqazi143
@tayyabqazi143 4 жыл бұрын
Bundle of thanks for this video I was searching a lot for this please upload a tutorial about mapping
@Techsithtube
@Techsithtube 4 жыл бұрын
Like Map function in react?
@CarlHamilton1914
@CarlHamilton1914 6 жыл бұрын
Excellent. This is exactly what I was looking for. To the point!
@viniciogomez9863
@viniciogomez9863 6 жыл бұрын
I have problems with the post for the sent through slim framework 3, Error say "Failed to load resource: the server responded with a status of 405 (Method Not Allowed)" sends as method "Option". I'm using Angular 6.
@d-one-and-only
@d-one-and-only 7 жыл бұрын
any idea why [routerLinkActive] won't work on this example?
@Techsithtube
@Techsithtube 7 жыл бұрын
Which version of angular are you using?
@phemant24
@phemant24 7 жыл бұрын
Hello Sir, What is the difference between @angular/common/http and @angular/http ?
@Techsithtube
@Techsithtube 7 жыл бұрын
I believe prior to v4.3 @angular/http was used. However , not it seems the new way is @angular/common/http. which means You need to inject HttpClient in your component/service not the module. If you import HttpClientModule in your @NgModule Also pay attention that old http was injected using Http class token instead of the new HttpClient. Going forward the old http client will be deprecated. so dont use it.
@phemant24
@phemant24 7 жыл бұрын
Thank You very much for very quick reply.
@yanivsalman9685
@yanivsalman9685 7 жыл бұрын
one of angular 5 changes was @angular/common/http in the future @angular/http wont be supported anymore so dont use it. more changes : / Pipes /how to import observable and some changes in the Form Module and lifeSicleHooks plus rxjs and typecript versions updated.
@phemant24
@phemant24 7 жыл бұрын
Yaniv Salman thank you bro
@avinashmohite6933
@avinashmohite6933 7 жыл бұрын
i have one issue. animation effect not working on tab selection in angular 5 . how to resolve this issue.
@Techsithtube
@Techsithtube 7 жыл бұрын
sure. where did you put the CSS for tabs?
@avinashmohite6933
@avinashmohite6933 7 жыл бұрын
sir please check this link frameworkinfotech.com/ some effect on home page first time work perfectly but when go to any other tab and back to home tab then affect not working in angular 5 in angular 4 work perfectly. i have use in angular 4 ngOnInit() { this.loadScript('assets/js/animate/animate-function.js'); } public loadScript(url) { console.log('preparing to load...') let node = document.createElement('script'); node.src = url; node.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(node); } but this not work for angular 5 please give me solution.
@Techsithtube
@Techsithtube 7 жыл бұрын
I would suggest instead of loading it on ngOnInit() . What you have done is a hack and loading a js file is async process it may or may not work depending on when this file is received. Better solution is to create a utility lib with animate functions and import it to this component. Import would make sure that the file is there before using it.
@avinashmohite6933
@avinashmohite6933 7 жыл бұрын
Thanks but how to do it. should you give me example?
@amirtav7249
@amirtav7249 7 жыл бұрын
hi thank u for ur video but i still have this problem and error 'Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response.' i watch 1000 other videos and i just can request to https and when i request to localhost or some ther servers that are not https i still have that error can u help me what sgould i do? i do what u tell me step by step and still dosent work
@Techsithtube
@Techsithtube 7 жыл бұрын
I think you might have some security issue. let's try one last thing. you can install chrome extension access-control-expose-headers . it will be added to your chrome on the top right bar. Make sure it's enabled which means its green. then open its settings. you might already have some settings. just remove that and click on the + sign and add *. close the browser and reopen. then see your solutions works. Let me know what happens.
@SaiPrakash16
@SaiPrakash16 7 жыл бұрын
hi , Had a query if you are aware - if I have a json format { Entries : [ { id:1, name: abc, class:a }] } how do I create the interface here to send out a put or post here ?!
@Techsithtube
@Techsithtube 7 жыл бұрын
Here instead of an profile in my example, you have Entries. which means you would get yourAPI/Entries/name=abc Have you created an rest api for this?
@SaiPrakash16
@SaiPrakash16 7 жыл бұрын
yes, we have an API which takes this as JSON as an input for an update . The question is how to do we go about creating a model that would be in the above format ?
@Techsithtube
@Techsithtube 7 жыл бұрын
You mean represent this data in typscript interface? you can do something like this interface Entries { [index: number]: { id: number; name: string; class: any }; }
@SaiPrakash16
@SaiPrakash16 7 жыл бұрын
yes a TS interface, not in this format , thanks for your time anyways, have found a way :)
@madant2697
@madant2697 6 жыл бұрын
a very good and easy to understand tutorial..ty sir..
@Reaper_f30
@Reaper_f30 6 жыл бұрын
hey man nice tutorial.. question though.. should api call not be done in a service file instead?
@shubhamsoni6013
@shubhamsoni6013 6 жыл бұрын
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:4200' is therefore not allowed access. after adding interseptopr file in app, and included in app.module.ts please help me,
@naderafshari3456
@naderafshari3456 6 жыл бұрын
Did you fire this out? Did it have to do with localhost?
@AnjaniNaina
@AnjaniNaina 5 жыл бұрын
Hi Sir, I need help, can you please tell me how can I call an API which belongs to different domain form my localhost server, because currently, I am facing the cross-origin issue.
@warrenclarin6488
@warrenclarin6488 7 жыл бұрын
Great tutorial .. but how can i do this using Services then pass the response to a Component ?
@Techsithtube
@Techsithtube 7 жыл бұрын
Actually its very simple. Move the http get/post code into a service and . Inject service to which ever component you are trying to use. Look at the last few tutorials on services and observable I released.
@warrenclarin6488
@warrenclarin6488 7 жыл бұрын
please help me sir .. i can get data from an API using services and successfully received a response .. but i don't know how to pass the response from this service to a component .. :(
@nzjemountfort
@nzjemountfort 7 жыл бұрын
+Warren Clarin kzbin.info/www/bejne/mpLbloyfq5p5fs0
@sivaprakas9828
@sivaprakas9828 7 жыл бұрын
Do you have full angular course? i want to learn angular? so which version is suitable for me to learn ?
@Techsithtube
@Techsithtube 7 жыл бұрын
So far I have covered installation + setup, Creating new components, Data down Actions up and Http get/post. Please check it out. And in next few weeks, I will release , service, routes and styling,
@nirjharpaul
@nirjharpaul 6 жыл бұрын
Why you did not use two way binding
@Techsithtube
@Techsithtube 6 жыл бұрын
I have a separate video on two-way binding you can check it out on my channel. Thanks for watch it.
@opendojo929
@opendojo929 6 жыл бұрын
very nice tutorial! Do you have one where you teach how to chain Observables correctly with HttpClient?
@Techsithtube
@Techsithtube 6 жыл бұрын
You mean chain multiple promises?
@opendojo929
@opendojo929 6 жыл бұрын
Thx for your response. :) I mean how do you use the response of the first http request for the second? Because they are async the might not be ready when using them. Right now I put the second request inside "complete".
@Sankey369
@Sankey369 7 жыл бұрын
I have defined child routes which accepts parameter from parent. I am using this parameter to make GET request data from API which return value to same object. So when I change parameters from parent, it should refresh child component with new data. I am not getting view refreshed. can you suggest what can be done to resolve this?
@Techsithtube
@Techsithtube 7 жыл бұрын
Yes it should update the data. Can you first make sure that parent is passing the data to child using console.log() first.
@Sankey369
@Sankey369 7 жыл бұрын
Parameters are received in child as expected. It is the service which is getting different data but assigning to same variable. This variable i have used in child component to iterate over tr tag.
@Techsithtube
@Techsithtube 7 жыл бұрын
Oh I see. Where is the code? I can take a look if its in public domain like github.
@Sankey369
@Sankey369 7 жыл бұрын
I have posted my question on StackOverflow. stackoverflow.com/questions/48223175/child-component-is-not-updating-when-data-inside-object-is-changed/48228038#48228038
@vijayan5041
@vijayan5041 7 жыл бұрын
Thanks for this tutorial. I just have one question that I am getting [object Object] instead of actual response from the server. Could you please help? Thanks.
@Techsithtube
@Techsithtube 7 жыл бұрын
can you console.log it to see what it its? you can also look at the network tab to see what you are actually getting.
@vijayan5041
@vijayan5041 7 жыл бұрын
it's something like this"{list: {…}} list : {q: "curd", sr: "28", ds: "any", start: 0, end: 25, …} __proto__ : Object"
@vijayan5041
@vijayan5041 7 жыл бұрын
after expanding"{list: {…}} list : ds : "any" end : 25 group : "" item : (25) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] q : "curd" sort : "n" sr : "28" start : 0 total : 231 __proto__ : constructor : ƒ Object() hasOwnProperty : ƒ hasOwnProperty() isPrototypeOf : ƒ isPrototypeOf() propertyIsEnumerable : ƒ propertyIsEnumerable() toLocaleString : ƒ toLocaleString() toString : ƒ () valueOf : ƒ valueOf() __defineGetter__ : ƒ __defineGetter__() __defineSetter__ : ƒ __defineSetter__() __lookupGetter__ : ƒ __lookupGetter__() __lookupSetter__ : ƒ __lookupSetter__() get __proto__ : ƒ __proto__() set __proto__ : ƒ __proto__() __proto__ : constructor : ƒ Object() hasOwnProperty : ƒ hasOwnProperty() isPrototypeOf : ƒ isPrototypeOf() propertyIsEnumerable : ƒ propertyIsEnumerable() toLocaleString : ƒ toLocaleString() toString : ƒ () valueOf : ƒ valueOf() __defineGetter__ : ƒ __defineGetter__() __defineSetter__ : ƒ __defineSetter__() __lookupGetter__ : ƒ __lookupGetter__() __lookupSetter__ : ƒ __lookupSetter__() get __proto__ : ƒ __proto__() set __proto__ : ƒ __proto__()"
@Techsithtube
@Techsithtube 7 жыл бұрын
ok in my example i am getting an array back so my code is written for an array. you are getting a json object so you need to change it to use that. Go it?
@vijayan5041
@vijayan5041 7 жыл бұрын
Could you please tell me exactly what should i write if i want to display this data on page?
@yogith9417
@yogith9417 5 жыл бұрын
If you are using the in-house developed spring boot API, just adding @CrossOrigin to controller will solve the Cross Origin problem.
@Techsithtube
@Techsithtube 5 жыл бұрын
Thats awesome. is it open sourse?
@yogith9417
@yogith9417 5 жыл бұрын
@@Techsithtube Yeah. Infact it is provided in spring framework itself, just like @RestController, @RequestMapping etc annotations. For more info on how to use it, www.baeldung.com/spring-cors
@arunkravi3213
@arunkravi3213 6 жыл бұрын
Great tutorial. Thanks. Well I didn't understand the last portion of the tutorial. While giving "http post request" , its not actually getting update in the "db.json" file. Only just id increment is showing. What have to do for the getting real updation to db.json file. Anyone please give me an answer.
@Reaper_f30
@Reaper_f30 6 жыл бұрын
hhmm when i set up the github and upload the db it doesnt work even copied on of the site
@Techsithtube
@Techsithtube 6 жыл бұрын
How did you uploaded this?
@78mindhunter
@78mindhunter 5 жыл бұрын
Hi, I am trying to implement your solution but when i try to consume "my" test web service (running on local development pc) at address localhost:50878 i get the cors error: Access to XMLHttpRequest at 'localhost:50878/api/causale/list/' from origin 'localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Trying to invoke your test web service I have no errors( so i think that client app has no issues and the header is correctly added). What i really don't understand is that invoking mine I get the error as if I didn't add the header (but the client app is obviously the same, changin only the server address and the value of the header i need to add). Am i missing something?
@78mindhunter
@78mindhunter 5 жыл бұрын
I found the problem: it was server side (.net core web api)... In Startup.cs I was missing then services.AddCors(); directive... perhaps you should mention in the tutorial...
@78mindhunter
@78mindhunter 5 жыл бұрын
forget what i said... there is no way to get this working...
@Techsithtube
@Techsithtube 5 жыл бұрын
Is is till the CORS issue?
@78mindhunter
@78mindhunter 5 жыл бұрын
Yes, i think i am missing something on the server. I think so because i can consume your test server even without adding any interceptor... and without adding any additional header to the request. It seems that your server accepts ANY request. In effect I can consume also my test server only if adding services.AddCors(o => o.AddPolicy("MyPolicy", builder => { builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); })); in the Startup.cs ConfigureServices Method and then adding app.UseCors("MyPolicy"); in the Startup.cs Configure Method But obviously this make useless the interceptor and the "custom" header added to the requests.
@edwar8117
@edwar8117 6 жыл бұрын
De Verdad muchas gracias mi pana, desde Venezuela. saludos!!
@ErwinCorzo
@ErwinCorzo 6 жыл бұрын
Venezuela
@VertoSH
@VertoSH 7 жыл бұрын
So clear and easy to understand. Nicely done ;)
@Techsithtube
@Techsithtube 7 жыл бұрын
Thanks for watching :)
@nicholas-davis
@nicholas-davis 6 жыл бұрын
What VS plugins are you using?
@Techsithtube
@Techsithtube 6 жыл бұрын
Actually I am using Atom editor and the packages I am using are linter, atom-beautify, file-icons, emmet
@InteresThingvideos
@InteresThingvideos 6 жыл бұрын
can you tell me how do i use csrf token from the backend. please.
@Zero_Bug_Zone
@Zero_Bug_Zone 7 жыл бұрын
Hello sir, As we can handle Rest Api with angular with the help of Http package . Is it possible to handle Soap Api also through Angular ?? Please let me know if you have any idea
@Techsithtube
@Techsithtube 7 жыл бұрын
look for ngx-soap, its a package that you can use with angular .
@Zero_Bug_Zone
@Zero_Bug_Zone 7 жыл бұрын
Thankyou sir I find few details on this which are a bit helpful.. if you can upload a video on ngx-soap soon that would be great. Thanks a lot
@yt1234567100
@yt1234567100 6 жыл бұрын
I do not why this line not working in the code this.age = data[0].age; return undefined. Help!
@Techsithtube
@Techsithtube 6 жыл бұрын
what do you get when you console.log(data)
@yt1234567100
@yt1234567100 6 жыл бұрын
I think It might be something wrong with my JSON data, I used string to build JSON. \" to build JSON by add those strings.
@Techsithtube
@Techsithtube 6 жыл бұрын
Oh ok . Look at the network tab and copy the response. you can verify if the response if valid JSON or not.
@yt1234567100
@yt1234567100 6 жыл бұрын
thanks..
@yt1234567100
@yt1234567100 6 жыл бұрын
The data is valid, but data:any[], data[0] is array all strings. data[0] is the position of character array. For example: data[0] = {"1":"test"}, would be "{"
@maboodahmad7289
@maboodahmad7289 5 жыл бұрын
Cors error is not resolving after using clone request..I m using crome and rest api
@Techsithtube
@Techsithtube 5 жыл бұрын
Did you try the chome extenstion?
@maboodahmad7289
@maboodahmad7289 5 жыл бұрын
There was issue related to php version .It has been resolved now..And thank you so much ,such a nice tutorial.
@sauravdas7591
@sauravdas7591 6 жыл бұрын
how do you put yourself in the right bootom of the video
@Techsithtube
@Techsithtube 6 жыл бұрын
Its the software camtesia, which has pic in pic feature.
@christeennathaliyafernando
@christeennathaliyafernando 6 жыл бұрын
${this.name} is not working why is that? how to write get url to get data from postgresql database?
@Techsithtube
@Techsithtube 6 жыл бұрын
It doesnt matter what database it is , as long as you have a rest api set up. WHat is your code looks like?
@indianfootball2328
@indianfootball2328 7 жыл бұрын
simplified and awesome, thanks a lot
@Devnikakiduniya
@Devnikakiduniya 7 жыл бұрын
Hi Sir , I have doudt about access control exposs how i install in my System ?
@Techsithtube
@Techsithtube 7 жыл бұрын
you mean Access-Control-Expose-Headers ?
@Devnikakiduniya
@Devnikakiduniya 7 жыл бұрын
techsith yes
@itcook5874
@itcook5874 7 жыл бұрын
Hai ..am getting below error , " Property 'get' does not exist on type 'HttpClientModule'.", I have followed same as vedio still am getting this error, can you please help me here?
@Techsithtube
@Techsithtube 7 жыл бұрын
Sure I can help you debug. Can you tell me what version of Angular are you using. you can go to pacakge.json and look at the version there.
@itcook5874
@itcook5874 7 жыл бұрын
Hai thanks for you reply and great time.. below is my package.json file { "name": "trust", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^5.0.2", "@angular/common": "^5.0.2", "@angular/compiler": "^5.0.2", "@angular/compiler-cli": "^5.0.2", "@angular/core": "^5.0.2", "@angular/forms": "^5.0.2", "@angular/http": "^5.0.2", "@angular/platform-browser": "^5.0.2", "@angular/platform-browser-dynamic": "^5.0.2", "@angular/platform-server": "^5.0.2", "@angular/router": "^5.0.2", "core-js": "^2.4.1", "rxjs": "^5.4.2", "typescript": "^2.6.1", "zone.js": "^0.8.18" }, "devDependencies": { "@angular/cli": "1.4.9", "@angular/compiler-cli": "^4.2.4", "@angular/language-service": "^4.2.4", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.2.0", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.3.3" } }
@itcook5874
@itcook5874 7 жыл бұрын
i have changed "HttpClientModule" to "HttpClient" .. still i get error like "compiler.js:15830 Uncaught Error: Unexpected value 'HttpClient' imported by the module 'AppModule'. Please add a @NgModule annotation." in my consloe
@itcook5874
@itcook5874 7 жыл бұрын
Hey i got the issue.. thank you :-)
@Techsithtube
@Techsithtube 7 жыл бұрын
What was the problem?
@RajeevKumar-jt8vl
@RajeevKumar-jt8vl 6 жыл бұрын
hey sir where use your api url..
@Techsithtube
@Techsithtube 6 жыл бұрын
I use the api url for HTTP GET and POST
@RajeevKumar-jt8vl
@RajeevKumar-jt8vl 6 жыл бұрын
thanks sir
@nagarjuna1207
@nagarjuna1207 6 жыл бұрын
I might be very bad in basics but want to know why we are importing any module two times? Once in app.module.ts and again in the actual component file where we are going use. Am I missing anything
@hemantkakodia9381
@hemantkakodia9381 6 жыл бұрын
Hi. Thanks for the tutorial. I am facing the same issue while making a GET call to cross domain, i tried to add your Interception but even after that, i am facing same issue. Any suggestion would be welcome.
@ganapathilana7069
@ganapathilana7069 6 жыл бұрын
need to update if your working in Angualr5 version.HttpClientModule in app.moudle.ts instead of HttpClinet. import in app.component.ts same. no change in that part
@tayfoooooor
@tayfoooooor 7 жыл бұрын
what does exactly CORS prevent you from??? I thought is will prevent you requesting your local server::: e.g when using development server (angular and laravel) all on the same machine !!!!
@Techsithtube
@Techsithtube 7 жыл бұрын
A user agent makes a cross-origin HTTP request when it requests a resource from a different domain, protocol, or port than the one from which the current document originated.
@skverskk
@skverskk 6 жыл бұрын
Maybe I'm missing something here. So, I add the interceptor.module.ts to the root area of my Angular5 App. I then add it to the app.module.ts file. I have a service that does CRUD operations. So, the part I'm not understanding is, where does this interceptor module fit into my angular app? Do I inject it into my component? Do I have to hard code my endpoint inside the interceptor.module file? Does anyone have a code snippet showing the whole process? Thanks for any help..
@thetravelok106
@thetravelok106 7 жыл бұрын
is possible with relative path?... example this.http.post('php/test.php', { a: 'foo', b: 'bar', })
@neerajupadhyay1509
@neerajupadhyay1509 6 жыл бұрын
Dear i have an problem when i am passing parameter in your given url can you please help me into this
@dhyanijoshi2288
@dhyanijoshi2288 5 жыл бұрын
still it is giving same CORS error in my project..i dont know why
@Techsithtube
@Techsithtube 5 жыл бұрын
Did you change the settings and used the addon as i suggested. ?
@dhyanijoshi2288
@dhyanijoshi2288 5 жыл бұрын
@@Techsithtube interceptor is making no change in error...so i tried adding a chrome extension..if worked...but again it is showing error of server down since 3days...
@dhyanijoshi2288
@dhyanijoshi2288 5 жыл бұрын
i simply want to upload a file from angular to flask server via post method..
@janasenapartyvideos
@janasenapartyvideos 7 жыл бұрын
still cors issue ->Failed to load services.groupkt.com/country/get/all: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'localhost:4200' is therefore not allowed access. The response had HTTP status code 403.
@Techsithtube
@Techsithtube 7 жыл бұрын
Have you checked the network tab to see what is being passed and received? Have you also tried the addon i suggested for chrome? if so what is its setting?
@abhishekkamalkishor3793
@abhishekkamalkishor3793 6 жыл бұрын
nice video, had a query ,how to send data in headers while http request, waiting to hear from you soon
@uploadtvsd
@uploadtvsd 6 жыл бұрын
Thanks, for the great tutorial. Can you help me out with an example how to post data with angular 5 and CI in localhost. I succeed to fetch data using CI model and controller, but unable to post data. Its an CORS issue I think, coz POST is always showing OPTIONS and 500 in console.
@prudhviraj8762
@prudhviraj8762 6 жыл бұрын
Hi...can u please give a code for login and logout with user credentials using angular5
@Techsithtube
@Techsithtube 6 жыл бұрын
I am planning to build the login page. And release it soon.
@fawadullahkhan
@fawadullahkhan 7 жыл бұрын
can u also do RSJX overview. thanks
@adnuzzolillo
@adnuzzolillo 7 жыл бұрын
Very well explained, You are awesome man!
@bhavikagarg2360
@bhavikagarg2360 6 жыл бұрын
Can you provide me your documentation on the basic Angular 5
@Techsithtube
@Techsithtube 6 жыл бұрын
I dont have any documentation . you can check out my gituhub site for code.
@meriembader4428
@meriembader4428 5 жыл бұрын
how can I get the URL of my server??
@Techsithtube
@Techsithtube 5 жыл бұрын
you can get your ip address from terminal command ipconfig and through website whatismyip .
@FadilMucia
@FadilMucia 6 жыл бұрын
Hi @Techsith and thanks for this video. I really understood how to do GET and POST. THANKS. I have a question now. Let's take this code you did here. How can I print a list of "users" that are in that JSON file? I need for sure an Array, but how can I populate an Array of a json file that exist in a URL? Thanks again. Please, if someone knows the answer, I would appreciate the help :)
@Techsithtube
@Techsithtube 6 жыл бұрын
If they are inside a json file than you would have to navigate to the array. for example returning Obj = { users:[]} then you have to say myUsersArray = Obj.users; Does that answer your question?
@sksoumitrakar
@sksoumitrakar 6 жыл бұрын
How to pass Cookie in header of Get request? I have been searching this since days but didn't get an answer
@ranavaibhav1
@ranavaibhav1 6 жыл бұрын
@techsith great tutorial, thanks so much. Can you explain how would basic authentication work in the same example?
@sanjayprasad6776
@sanjayprasad6776 6 жыл бұрын
Thanks for the wonderful video. Sir I would like to request you to make video on lazy loading.
@orgestbeqiri488
@orgestbeqiri488 5 жыл бұрын
Sir, you are a life savior.
@ayushisrivastava2794
@ayushisrivastava2794 5 жыл бұрын
Sir plz make a video on state management in angular 7
@thisalma
@thisalma 4 жыл бұрын
Thank you so much for the videos ...
@RakeshBitling
@RakeshBitling 6 жыл бұрын
how client side security handled ?
@matheusrambo8760
@matheusrambo8760 6 жыл бұрын
Thank you so much, from Brazil!
@أسامةسلامة-ع1ف
@أسامةسلامة-ع1ف 7 жыл бұрын
what if i want to login with facebook in angular ..how to it integrated with laravel passport ??
@Techsithtube
@Techsithtube 7 жыл бұрын
you can use angularjs-social-login package that would help you login with facebook.
@ymazalmazal1757
@ymazalmazal1757 6 жыл бұрын
Very nice, it seems to be for deeloppement only because the content of the json file is github...
@Techsithtube
@Techsithtube 6 жыл бұрын
yes it is for development only.
@StanleyBateswar
@StanleyBateswar 6 жыл бұрын
Explained very well. Thanks!
@vickyjagtap7025
@vickyjagtap7025 6 жыл бұрын
how can perform crud using laravel5.5
@Techsithtube
@Techsithtube 6 жыл бұрын
can you create rest api using laravel?
@vickyjagtap7025
@vickyjagtap7025 6 жыл бұрын
No I want to connect laravel as back end to angular 5
@oscartang9478
@oscartang9478 5 жыл бұрын
Hi sir, im from asia and do speak English, do you do a one to one online course on angular kindly ask....if so pls let me know pls thanks!
@Techsithtube
@Techsithtube 5 жыл бұрын
Yes i do one on one teaching. please send me a mail on techlover2000@gmail.com and we can talk .
@oscartang9478
@oscartang9478 5 жыл бұрын
ok! thz :Q
@anuragpatel3976
@anuragpatel3976 6 жыл бұрын
This is really nice and helpful. it would be more better if you create components and module manually that might give better understanding of concepts. not all vedios only one would be fine.
@Techsithtube
@Techsithtube 6 жыл бұрын
Anurag I have created components manually in first few videos. basically, when you create a component via cli you would see what has been created in the command line so follow that. I have a video on JavaScript modules check it out.
@anuragpatel3976
@anuragpatel3976 6 жыл бұрын
Yes, I have seen your javascript videos they are really helpful.
@fredericabdou8493
@fredericabdou8493 7 жыл бұрын
Can you please make a tutorial on how to intercept http request to add Token Bearers?
@Techsithtube
@Techsithtube 7 жыл бұрын
Sure I will make it part of a video for "login"
@fredericabdou8493
@fredericabdou8493 7 жыл бұрын
techsith thanks brother
@relangirama
@relangirama 5 жыл бұрын
This is very informative, Thanks for this tutorial
@Techsithtube
@Techsithtube 5 жыл бұрын
Thanks for watching Ram.
@vsooriyabandara
@vsooriyabandara 7 жыл бұрын
This is very helpful . Thanks a lot for your effort.
@ruchirai5775
@ruchirai5775 7 жыл бұрын
Nice videos.Request you to please add more questions on CSS html
@Techsithtube
@Techsithtube 7 жыл бұрын
Yes I have plan to add some more videos on CSS interview questions.
Уроки Angular 7 - Http. Работа с API на практике
12:24
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Angular 5 Unit Testing with Jasmine Karma and Protractor
17:32
Angular HTTP Client Quick Start Tutorial
9:56
Fireship
Рет қаралды 195 М.
How AI Got a Reality Check
8:53
Bloomberg Originals
Рет қаралды 6 М.
Stockfish Just Solved Chess
27:40
GothamChess
Рет қаралды 806 М.
How to deeply understand Angular signals (...or anything)
10:51
Joshua Morony
Рет қаралды 10 М.
Make Your API Requests INSANELY Fast in .NET
9:30
Nick Chapsas
Рет қаралды 48 М.
Angular Crash Course (2019)
1:24:09
Traversy Media
Рет қаралды 970 М.
Angular v19 Developer Event
22:54
Angular
Рет қаралды 70 М.
Angular 4/5 Routing Tutorial
18:35
techsith
Рет қаралды 40 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН