I've been developing a web app using symfony2 and now I added some Angularjs.
I have an input field, where you can filter products by name, the problem is the following, I've a controller in php, I do some queries, and then I render the view, passing the parameters, in this case I do something like this,
.......
return $this->render('default/index.html.twig',array( 'products' => $products));
My question is, if I wanted to filter those products by name using angular, how can I accomplish that? (I wanted something like phonecat-app in the official angular tutorial, where you can filter by name) So far I've done this:
var StoreApp = angular.module('StoreApp', []);
StoreApp.controller('StoreCtrl', function($scope,$http){
$http.get('http://localhost:8000').success(function(data){
$scope.stores = data;
});
});
The problem is that I don't know which URL to put in the GET parameter, I've several tables in the database, and I don't know how to address them. I'm using a local web server on port 8000, and Doctrine.