You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the geocoder and I'm only able to do so when I set the type to any on the function that receives the event. I'm new to Angular so probably using the wrong words so here's the code in question.
Error: src/app/components/leaflet-map/leaflet-map.component.html:6:63 - error TS2345: Argument of type '{ result: Result; }' is not assignable to parameter of type 'Result'.
Type '{ result: Result; }' is missing the following properties from type 'Result': bbox, center, place_name, place_type, and 7 more.
<mgl-control mglGeocoder (geocoderResult)="onGeocoderResult($event)"></mgl-control>
If I instead set the function to this I get results out fine:
Is the type actually just json or should I be handling this with Result as the type instead? If anyone could clarify this for me I'd appreciate it. I want to be doing things properly and I'm not sure if using any and parsing as json is a workaround or how I'm supposed to do it.
The text was updated successfully, but these errors were encountered:
I'm trying to use the geocoder and I'm only able to do so when I set the type to
any
on the function that receives the event. I'm new to Angular so probably using the wrong words so here's the code in question.In map.component.html
and in map.component.ts I have
This is the result when it tries to compile:
If I instead set the function to this I get results out fine:
Is the type actually just json or should I be handling this with Result as the type instead? If anyone could clarify this for me I'd appreciate it. I want to be doing things properly and I'm not sure if using any and parsing as json is a workaround or how I'm supposed to do it.
The text was updated successfully, but these errors were encountered: