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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -