Modify HTTP Data using Pipe

  Рет қаралды 30,372

Study Mash

Study Mash

Күн бұрын

Пікірлер: 129
@abderrahmankhalladi7577
@abderrahmankhalladi7577 3 жыл бұрын
man thanks i've been looking for long
@2023AllInOneEntertainment
@2023AllInOneEntertainment 2 жыл бұрын
those who are getting error here "propertiesArray.push(data[id]);" solution is " propertiesArray.push(data[id as keyof object]);"
@meseretzewde9536
@meseretzewde9536 2 жыл бұрын
thanks
@fridi419
@fridi419 2 жыл бұрын
is this done to tell typescript id is a field of the object and not a string?
@shashankshukla5438
@shashankshukla5438 2 жыл бұрын
Or just make the typeof data to any in map( (data: any).... not sure if this violates TS laws of strict type or not!
@shashankshukla5438
@shashankshukla5438 2 жыл бұрын
Also @Sandeep Kumar, would you be kind enough to explain what's going on here? data[id as keyof Object], the as keyof Object part? I did not understand why it works or how it works, TS docs isn't helpful at all! T.I.A.
@rahamathullahibrahim9303
@rahamathullahibrahim9303 Жыл бұрын
Thanks For the Solution.. it works perfectly...
@AJSpeller
@AJSpeller 4 жыл бұрын
I like your work. Please continue with the great tutorials.
@Saveyy1
@Saveyy1 4 жыл бұрын
at 3:07 adding constructor(private housingService: HousingService) { this.properties = []; } removes the error for me.
@subhamsoy1280
@subhamsoy1280 3 жыл бұрын
thanks
@thui09
@thui09 3 жыл бұрын
Thank you sir, you saved my life
@StudyMash
@StudyMash 3 жыл бұрын
Really
@chuchotech5513
@chuchotech5513 2 жыл бұрын
hello, I got an error when I introduce this line propertiesArray.push(data[id]); (TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'.) so,I have to introduce in the tsconfig this option "suppressImplicitAnyIndexErrors": true, and stop and start the angular project
@nawelmeziane454
@nawelmeziane454 2 жыл бұрын
thank you so much , I got this error and I didn't know what to do until I read your comment
@akgg7834
@akgg7834 Жыл бұрын
wasted one day and then after this message I was able to fix. thanks for the update
@nylonnalini
@nylonnalini Жыл бұрын
I got a Deprecation error on using "suppressImplicitAnyIndexErrors" and had to add '"ignoreDeprecations": "5.0"' to tsconfig to get it to work.
@ConstantinAlexandru-xf5zn
@ConstantinAlexandru-xf5zn 7 ай бұрын
adding definite assignment assertion "!" to the @Input fixed my error export class PropertyCardComponent { @Input() property!: IProperty; }
@michca123
@michca123 3 жыл бұрын
Please help. Pause at 2:57 to 2:58 i get an error line 18: data[id] is underlined red The message is: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'.ts(7053)
@StudyMash
@StudyMash 3 жыл бұрын
Can you give me the github link to your code
@ntt2k
@ntt2k 4 жыл бұрын
Can you explain why you decided to: return this.http.get('data/properties.json') in your housing.service. ts, with a pipe & map? How would it be different from: return this.http.get('data/properties.json') Do they deliver the same results? The pipe/map seems like there's a lot more confusing code involved, unless there is a benefit to using them. Can you please clarify? Thanks.
@StudyMash
@StudyMash 4 жыл бұрын
Agree, it will work perfectly with your code without pipe and map as well upto this point, But in case you would like catch some error or handle that in service method only, you will have to use pipe operate to intercept the same. And also in this tutorial we will further filter the data specific for sell or buy flag , so just wanted to show how we can intercept the response in using pipe and we can manipulate or map it to any other kind of object using map operator. Thanks for sharing your example and question, it really helps other as well to understand the concepts.
@ntt2k
@ntt2k 4 жыл бұрын
@@StudyMash Thanks for the explanation! Your channel is definitely underrated. I hope more people stumble across this channel, as I have, because you do explain these concepts really well!
@StudyMash
@StudyMash 4 жыл бұрын
Thanks a lot buddy, such appreciations really keep me motivated to improve me more and more.
@paskahlsimarmata137
@paskahlsimarmata137 3 жыл бұрын
why my data[id] error in 2:29...Please Help
@kumarvivek4665
@kumarvivek4665 3 жыл бұрын
same error i got !! any solution?
@mrtrader3661
@mrtrader3661 Жыл бұрын
I have error in this line: propertiesArray.push(data[id]); no index signature with a parameter of type 'string' was found on type 'object' angular
@tanweerkhan4751
@tanweerkhan4751 4 жыл бұрын
"The element is implicitly of type "any" because the expression of type "string" cannot be used for the index type "Object". No index signature with a parameter of the type "string" was found for the type "object". Ts (7053)" I will be thanksfull for your support
@fatimashehzadi8604
@fatimashehzadi8604 4 жыл бұрын
i have the same error its gone by writting "suppressImplicitAnyIndexErrors": true, in 'tsconfig.json' i hope this will help.
@fatimashehzadi8604
@fatimashehzadi8604 4 жыл бұрын
let me know if its help full or not?
@nawalfatima6220
@nawalfatima6220 3 жыл бұрын
@@fatimashehzadi8604 lots of duas for you girl i was stuck on it so bad. lots of prayers. stay blessed
@fatimashehzadi8604
@fatimashehzadi8604 3 жыл бұрын
@@nawalfatima6220 Ameen! thanks a lots
@akshitapurohit9145
@akshitapurohit9145 3 жыл бұрын
Hi@@fatimashehzadi8604 , I was stuck at same point, its now working fine with "suppressImplicitAnyIndexErrors": true, however the data[id] in service file is still showing red underline, is that okay?
@sohaibalvi6989
@sohaibalvi6989 2 жыл бұрын
data => { const propertiesArray : Array =[]; for(const id in data) { if(data.hasOwnProperty(id)) { propertiesArray.push(data[id]); } } return propertiesArray; } Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'. propertiesArray.push(data[id]);
@muhammadgul1049
@muhammadgul1049 2 жыл бұрын
nice
@abinkrajan2329
@abinkrajan2329 3 жыл бұрын
Hi sir, I get TS7053 error when using properties.push(data[i])
@StudyMash
@StudyMash 3 жыл бұрын
Can you share the github link to your code
@varghamehregan1183
@varghamehregan1183 3 жыл бұрын
I got the same Error ( No index signature with a parameter of type 'string' was found on type 'Object'.)
@punit20270
@punit20270 19 күн бұрын
what is observable and observer in angular?
@StudyMash
@StudyMash 16 күн бұрын
Observable: Produces data streams. Observer: Consumes and reacts to data streams emitted by an Observable
@DreamCatcher201
@DreamCatcher201 2 жыл бұрын
Following in March 2022: The Webpack 5 has come out -- "console.log" will not work. error TS2307: Cannot find module 'console' or its corresponding type declarations. 3 import { Console } from 'console';
@avinashg2008
@avinashg2008 3 жыл бұрын
@Input() property: IProperty; "Here I am getting 'property' has no initializer and is not defined in constructor" error. If I set it to undefined as well then property in template starts giving error. Please comment. Thanks for another excellent video
@StudyMash
@StudyMash 3 жыл бұрын
Is that defined in constructor
@Saeefar
@Saeefar 4 жыл бұрын
I am getting following errors 1... "Property 'properties' has no initializer and is not definitely assigned in the constructor.", 2.... "Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'.",
@nawalfatima6220
@nawalfatima6220 3 жыл бұрын
first one is resolved by initializing in constructor read previous comment by savvey1
@nawalfatima6220
@nawalfatima6220 3 жыл бұрын
for second error see above comment
@MrMoffettbrandon
@MrMoffettbrandon 3 жыл бұрын
go to tsconfig.json and set "strict" : false to fix
@arnabpattanayak8289
@arnabpattanayak8289 3 жыл бұрын
@@MrMoffettbrandon It works for me. Thank you a lot 🙏
@greencoder3795
@greencoder3795 3 жыл бұрын
Set "strict":false in tsconfig.json file , it worked for me
@sohampatra1207
@sohampatra1207 2 жыл бұрын
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'.ts(7053) "What to do for this error"
@DB-zh8gy
@DB-zh8gy 2 жыл бұрын
have the same problem any solution?
@aslamhossain8435
@aslamhossain8435 2 жыл бұрын
same problem
@naveenkumarshetty650
@naveenkumarshetty650 2 жыл бұрын
same issue
@fridi419
@fridi419 2 жыл бұрын
@@aslamhossain8435 did u fix
@shashankshukla5438
@shashankshukla5438 2 жыл бұрын
make these adjustments: map( (data:any).... rest remains the same. Here you're telling TS that the data you're receiving is an "ANY" type object and NOT an "Object" type. I think it violates the TS laws but that's just the workaround I found. @StudyMash AM I correct here?
@PriyankaSharma-qt4nt
@PriyankaSharma-qt4nt Жыл бұрын
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'.ts(7053) how to solve this error??
@vaynard94
@vaynard94 4 жыл бұрын
why intellisense in my vs code does not show the property attribute like yours? But if I mistype it ex. property.Nmae, it will show error "Propery 'Nmae' does not exist on type 'IProperty'".
@vaynard94
@vaynard94 4 жыл бұрын
got the answer, Angular Essentials didnt installed properly. Thank you
@kasperkat2004
@kasperkat2004 4 жыл бұрын
@@vaynard94 I also had that problem. I disabled it, then enabled it and restarted vs code. now it works. I also uninstalled some other intellisense extensions as they may have been interfering.
@somaihamza1516
@somaihamza1516 3 жыл бұрын
@@kasperkat2004 it worked for me but it shows object object ( excuse me but this angular is a pain in the ass)
@vaynard94
@vaynard94 4 жыл бұрын
Is this interface the same as class in c#? but in different concept?
@StudyMash
@StudyMash 4 жыл бұрын
Purpose is same to define a contract with the type that implement it.
@vaynard94
@vaynard94 4 жыл бұрын
sounds interesting. will there be back end session in this course? or should i look in "Build Real World Web Application with ASP.NET Core and MVC Framework"? thank you
@StudyMash
@StudyMash 4 жыл бұрын
Yes, I will connect it with backend, but meanwhile it is good to get some idea from that course.
@nawalfatima6220
@nawalfatima6220 3 жыл бұрын
im unable to access data id this is the error im gettin in vs code : Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'.ts(7053) if i try to console log data in service file in for in loop i get the whole array.but in the same code block im unable to access id from the data object
@StudyMash
@StudyMash 3 жыл бұрын
If you can provide the github link to your code I can look where the problem is
@lipunpatel9599
@lipunpatel9599 3 жыл бұрын
@@StudyMash Hi Sir, I am also getting the same error - github link - github.com/lipun619/HSPA.git Please look into it once
@tendulkrish3573
@tendulkrish3573 3 жыл бұрын
@@lipunpatel9599 same problem here also. Did you got any solution?
@MrMoffettbrandon
@MrMoffettbrandon 3 жыл бұрын
go to tsconfig.json and set "strict" : false to fix
@phuongngaphan2525
@phuongngaphan2525 3 жыл бұрын
@@MrMoffettbrandon oh i fixed it, thank you
@danieletilocca7637
@danieletilocca7637 3 жыл бұрын
i have the problem 'Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'.'. i tried writing "suppressImplicitAnyIndexErrors": true, in 'tsconfig.json', but it doesn't work. any help?
@danieletilocca7637
@danieletilocca7637 3 жыл бұрын
if it doesn't work and i can't fix it, can i use "any" and continue the playlist without following this video? thanks
@StudyMash
@StudyMash 3 жыл бұрын
Ok if you are able to go with any, you can proceed with that. Do you have this code available on github, may be I would be able to find the issue if you can provide me github link
@danieletilocca7637
@danieletilocca7637 3 жыл бұрын
@@StudyMash it's weird because now it seems it works, there aren't any errors, but i don't see the list of properties when i use "ng serve"... it only appears the nav-bar. i try to upload on github
@danieletilocca7637
@danieletilocca7637 3 жыл бұрын
how can i give you the link of github?
@StudyMash
@StudyMash 3 жыл бұрын
you can watch this (kzbin.info/www/bejne/gKW1f5ispNl3Zqs) video to learn how to add your code to github repository, in that way, when ever you have problem you can share the link to me and I can look your code.
@Chan_1641
@Chan_1641 2 жыл бұрын
Hi sir. Can you share this Particular Tutorial Source, To Clear my Errors and Doubts
@StudyMash
@StudyMash 2 жыл бұрын
github.com/webtrainer-in/HSPA
@maheshuppala71
@maheshuppala71 4 жыл бұрын
Error: src/app/services/housing.service.ts:20:32 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'. 20 propertiesArray.push(data[id]); I am getting this error please helpme
@StudyMash
@StudyMash 4 жыл бұрын
Seems you have not initialized properties Array as an array.
@daniwalker1996
@daniwalker1996 4 жыл бұрын
@@StudyMash how to initialized ? any body can help??
@daniwalker1996
@daniwalker1996 4 жыл бұрын
did you solve it ?
@nehemiahlimocheburet1411
@nehemiahlimocheburet1411 4 жыл бұрын
how did you solve it?
@nehemiahlimocheburet1411
@nehemiahlimocheburet1411 4 жыл бұрын
am still waiting for some response on this, hello @Study Mash
@tripshower2all
@tripshower2all 3 жыл бұрын
How to handle httperror inside pipe
@TaniaAkter-ql4ow
@TaniaAkter-ql4ow 4 жыл бұрын
Hi,Sir...now I'm ur big fan...Thanks a lot...But when i import interface in my list.component.ts file I got an error:Can't find module'../IProperty.interface'....Please help me.....
@StudyMash
@StudyMash 4 жыл бұрын
You must be not pointing it to the correct folder where you have placed your interface.
@TaniaAkter-ql4ow
@TaniaAkter-ql4ow 4 жыл бұрын
@@StudyMash I created interface file in property folder...please tell me where should I create interface???
@StudyMash
@StudyMash 4 жыл бұрын
@@TaniaAkter-ql4ow It doesn't matter where you create your interface, but when importing it in any other file you will have to correctly point to that directory. Otherwise you will get error.
@srinivasrapaka4729
@srinivasrapaka4729 Жыл бұрын
This error will caused by failure of the ng server u can run with different port it will work
Understand Routing - Part-1
6:47
Study Mash
Рет қаралды 19 М.
Using Service and HTTP calls in Angular 9
13:32
Study Mash
Рет қаралды 32 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 104 М.
How to structure a JS/TS monorepo (From Zero to Turbo - Part 1)
11:58
I Wrote HTTP "From Scratch" (It Was Easy)
19:07
Sean Bix
Рет қаралды 89 М.
RxJS tutorial in practical way (with pipe, map, filter, tap) 🔥
13:13
TheAngularCoder || Gourav
Рет қаралды 18 М.
Rxjs Streams in Angular - Normalizing Data (Map and Pipe Operator)
12:18
Monsterlessons Academy
Рет қаралды 27 М.
Tap Operator in Rxjs | Tap Operator in Angular
5:49
Fun Of Heuristic
Рет қаралды 13 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН