Right. So based off what Nikita mentions and the link posted, basically, you have two options. Preload all your data that is then filtered locally in Angular, or make XHR (ajax, api, http) calls to php server which returns JSON to populate the page.
Personally, we built filters for our UI in angular and each change fires a request to the backend since our data is too large to load at any one time. (like thousands of documents) We just made sure that our queries were optimal so that the user experience is fast. An example? Use $http or $resource in angular to call your url that defines the params needed: http://www.mydomain.com/api/documents?status=approved You should be able to handle the PHP side of this sort of request. On Thursday, March 27, 2014 12:51:50 PM UTC-6, Nikita Tovstoles wrote: > > Am not an expert but i think the short answer's 'no': > https://groups.google.com/forum/#!msg/angular/HzKDXvvsviQ/w_Slenm3n4sJ > > basically, HTTP requests == async computation (i.e. promises) and filter > impl are supposed to return a value immediately. You'll probably want to > pre-fetch filtered collection instead. > > On Monday, March 24, 2014 6:59:22 AM UTC-7, Reynier Pérez wrote: >> >> In a application I'm working on I need to add some filters like for >> example: approved, with documents, with documents approved and some others. >> All these filters is based on MySQL queries to DB performed by PHP >> controller (I'm using Symfony2) and the functions on that controllers will >> return a well formed JSON. My question is: can I write filters for >> AngularJS based on this behavior? How? (I mean a little example just for >> understand the flow) >> > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
