angularjs - Init function only runs every second time -
for strange reason ini() function runs every second time. have issue in app well...
i have no idea why.
my code:
<ion-view ng-init="ini()"> <ion-header-bar class="banner-top ext-box" align-title="left"> <div class="int-box2"><h2 id="s_back1">map stories</h2></div> </ion-header-bar> <ion-content overflow-scroll="true" class="has-header has-footer no-bgcolor" scroll="false" >
js
.controller('mapctrl', function($scope, $state, $http) { $scope.ini = function() { $http({ method : "get", url : "https://domain.ch/pois.php" }).then(function mysucces(response) { console.log("success"); }, function myerror(response) { $state.go("error"); }); } })
route
.state('map', { url: '/map', templateurl: 'templates/map.html', controller: "mapctrl" })
Comments
Post a Comment