I have an app I'm developing on ionic
and angularjs
I'm using routes
and I'm fetching data from a database on a remote server, I have a page where I listed several categories and each category has an associated id
of the category.
My problem is now when I click on the category send the id to php and on the next page I list the establishments corresponding to this category but I do not know how to do it, I would like a help tips how can I do that.
Route
.state('app.estabelecimentos', {
url: "/estabelecimentos/:id",
views: {
'menuContent': {
templateUrl: "templates/estabelecimentos.html",
controller: 'ListaDistritos'
//controller: 'CategoriaComer'
}
}
})
Category listing
<div class="row" ng-repeat="cat_comer in comer">
<div class="col">
<a href="#/app/estabelecimentos/{{cat_comer.id}}">
<div style="background: url(https://www.sabeonde.pt/gtm/anexos/colecoes/{{cat_comer.id_anexo}}.{{cat_comer.tipo}}); border-radius: 6px; height: 200px; background-size: 100% 100%; background-repeat: no-repeat;">
<div class="texto_categorias">
<div class="titulo_estabelecimentos">{{cat_comer.campo_slug}} ESTABELECIMENTOS</div>
{{cat_comer.titulo}}
</div>
</div>
</a>
</div>
</div>