There are three major parts of this program. One is an input form, one is a php file, and the last is a table. The when the user enters a query into the input form, the php file should perform a custom query based on what was entered in the input form, and then return the result in JSON format. A table should then be made, based on the results. And, if the user enters a new query into the input form, the old table should be replaced by a new one.
I am wondering what the best AngularJS structure for such a program is? I was thinking the following: I make a controller, and add some results dictionary list to the $scope of the controller, which stores the JSON output of the sql query. I also bind the input form to some variable $scope.input. Then, I add a function $scope.performQuery() to the query, which makes a customized AJAX call to the PHP file based on $scope.input, which of course means that I should make my controller have a dependency on $http.
Would, this be the best structural approach to this? I am new to AngularJS, so I wasn't sure if there is a more elegant way.