ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: $scope.$watch and $scope.$apply issue with tabs

Open csarnevesht opened this issue 11 years ago • 2 comments

Type: bug

Platform: desktop browser

I am trying to get the code in http://jsfiddle.net/Wijmo/Rqcsj/ to work on a tabs project.

I created a fresh tabs project "ionic start app-map-tabs tabs" and then I added the code from the above example into the Account tabs.

I can see the map and the markers fine, but the gotoLocation function only works the first time, after that it doesn't.

$scope.gotoLocation = function (lat, lon) { if ($scope.lat != lat || $scope.lon != lon) { $scope.loc = { lat: lat, lon: lon }; if (!$scope.$$phase) $scope.$apply("loc"); } }; I think there is some issue with scoping here...

Could someone please help?

I have placed all the code I created in https://github.com/csarnevesht/ionic-map-tabs

Any help would be greatly appreciated!

csarnevesht avatar Feb 10 '15 17:02 csarnevesht

Greetings @csarnevesht!

My sensors indicate that you have created an issue on our tracker requesting usage help, rather than an actual error with Ionic framework.

This GitHub issue tracker is used to track framework features, problems, and development.

If you wish to get help using the framework itself, the recommended place is the forum. There are many humans there who would be happy to offer sage advice.

Thank you for allowing me to assist you.

Ionitron avatar Feb 10 '15 18:02 Ionitron

Greetings!

I have a feeling there is a bug somewhere with scoping... I applied the very same code to a blank ionic project and to a tabs ionic project. the code works on the blank ionic project but not on the tabs one... some scope watch issue i believe...

i have also posted this issue on the forum but have gotten no reply... how can i get help with this?

thank you in advance!

csarnevesht avatar Feb 10 '15 18:02 csarnevesht