I can read my backend, but I can not show the data in my view, what can I be doing wrong?
In my controller I did the following, and I asked to read my backend:
.controller("restaurantesCtrl", function($scope,$state,$ionicScrollDelegate,$http,$stateParams,$timeout,$ionicLoading,$ionicPopup,$ionicPopover,$ionicSlideBoxDelegate,$ionicHistory,ionicMaterialInk,ionicMaterialMotion){
$scope.itens = [];
$http.get('http://nhac.esy.es/lista_restaurantes.php')
.success(function(itens){
$scope.itens = itens;
console.log("leu");
console.log($scope.itens = itens);
})
.error(function(erro){
console.log(erro);
console.log("não leu")
});
In my view I did the following:
<ion-view view-title="Restaurantes" hide-nav-bar="false" >
<ion-content delegate-handle="top" lazy-scroll id="page-restaurantes" class="has-header page-restaurantes" >
<ion-refresher pulling-text="Role para atualizar..." on-refresh="doRefresh()"></ion-refresher>
<ion-list class="card list">
<div class="item item-input">
<i class="icon ion-search placeholder-icon"></i>
<input type="search" ng-model="q" placeholder="Procurar" aria-label="filter promoess" />
</div>
</ion-list>
<div class="list" ng-repeat="r in itens track by $index" >
<a class="item item-thumbnail-left" href="#/nhaac/restaurante_singles/">
<img src="/img/logo_restaurante.jpg">
<h2>{{r.fornecedores_fantasia}} </h2>
<h3>{{r.fornecedores_bairro}} </h3>
<i><rating ng-model="contato.stars" max="rating.max"></rating></i>
<p>Aqui a descrição do restaurante. </p>
<button class="button button-block button-royal">
VER AS PROMOÇÕES
</button>
</a>
</div>
<ion-list class="list">
<div class="item" ng-if="results.length == 0" >
<p>Nenhum resultado encontrado...</p>
</div>
</ion-list>
</ion-content>
</ion-view>
Remembering that I'm looking for the results of link
In my log, list everything. But the view does not list anything ...