Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Variable resetting to null?

$
0
0

@nanexcool wrote:

I have a simple page with an input and two buttons. These buttons each have a click function: getLocation() and test().

The input has an ngModel of latLng

When I run getLocation() I set the this.latLng variable to the coordinates returned. I do a console.log and see that it's working correctly.

But then I run the test() function, which logs the exact same variable (this.latLng) and it's null again!

What am I missing?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>