0

This was suppose to be simple, I've used show/hide plenty of times... 2 hours later nothing... works on brower... it doesn't work on the mobile andriod device I'm testing on.

 <li class="item" style="text-align:center" ng-if="showBlist==0">
   No bouncr's available
 </li>
 <li class="item" ng-repeat="data in bouncrList" ng-if="showBlist==1">
    <a class="item item-avatar" href="#">
      <img src="{{avatar}}">
      <h2>{{data.name}}</h2>
      <p>{{data.venue}}, {{data.address}}</p>
    </a>
  </li>


$ionicPlatform.ready(function() {

  $scope.initMap = function() {

    $scope.positions = [];
      $ionicLoading.show({
      template: 'Loading...'
    });

  navigator.geolocation.getCurrentPosition(function(position) {

      var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

      map = new google.maps.Map(document.getElementById('map'), {
        center: pos,
        zoom: 12
      });

      infowindow = new google.maps.InfoWindow();
      var service = new google.maps.places.PlacesService(map);
      service.nearbySearch({
        location: pos,
        radius: 5000,
        type: ['night_club'],

      }, callback);

      function callback(results, status) {
        if (status === google.maps.places.PlacesServiceStatus.OK) {
          for (var i = 0; i < results.length; i++) {
            createMarker(results[i]);

          }
        }
        var locale = JSON.stringify(results[0].vicinity);

            bouncrFactory.bouncrs(locale).then(function(data){

              $scope.bouncrList = data.data.bouncrs
              $rootScope.showBlist = data.data.showBlist

            })
            $rootScope.$apply()
      }

      function createMarker(place) {
        var placeLoc = place.geometry.location;
        var marker = new google.maps.Marker({
          map: map,
          position: place.geometry.location
        });

        google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(place.name);
          infowindow.open(map, this);

          console.log(place.name)
        });
      }
      $ionicLoading.hide();
  })

  }

$scope.initMap()

  });

$ionicPlatform.ready was added from another solution $scope.apply was added from another solution

i've used

$timeout(function(){
  ...
},1000)

and every other solution i can find

user2320607
  • 425
  • 1
  • 8
  • 19
  • Could you check the console log on your android browser. you can check it by chrome inspect. https://developer.chrome.com/devtools/docs/remote-debugging – Midhun Darvin Mar 13 '16 at 05:45
  • 1
    turns out it's a php and ionic problem, not getting a response from the php page... just getting the html of the php page instead – user2320607 Mar 13 '16 at 08:36
  • So were you able to solve it?. I have had a similar problem. You might want to check this out : http://stackoverflow.com/questions/30326148/cordova-ionic-http-request-not-processing-while-emulating-or-running-on-dev – Midhun Darvin Mar 13 '16 at 12:38

0 Answers0