6
I have an app I’m developing on ionic
and angularjs
I’m using routes
and I’m fetching the data from a database on a remote server, I have a page where and listed me several categories and each category has a id
associate of the category.
My problem is now by clicking on the category send the id to php and on the next page list me the establishments corresponding to this category but do not know how to do, I would like a help tips how I can do this.
Route
.state('app.estabelecimentos', {
url: "/estabelecimentos/:id",
views: {
'menuContent': {
templateUrl: "templates/estabelecimentos.html",
controller: 'ListaDistritos'
//controller: 'CategoriaComer'
}
}
})
Listing of categories
<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>
Yes but how do I send the category id to php ?
– César Sousa
You pass as parameter to $http =
$http.get(user.details_path, {
 params: { user_id: user.id }
});
– henriquedpereira