Reputation: 180
I have tried to look for tutorials on this but nothing simple and to the point...
Could anyone give me an example or link me to a tutorial on how to post data with angularjs to a php page?
And also with angularjs call a php file to get data in order to display a list of lets say a phonebook.
How can this be done with angularjs? I can do all this with php but i want to know how to do it with Angularjs to visualize and call php files and those PHP files would read/write on the db.
I want to use plain php(no php frameworks for now).
Thanks
Upvotes: 1
Views: 7875
Reputation: 1833
After a long search, I've found a simple and best guide for AngularJS beginners. This example AngularJS application contain the following functionalities.
If you are looking for a simple AngularJS application with step-by-step guide, must check this tutorial - AngularJS CRUD Operations with PHP and MySQL
Upvotes: 0
Reputation: 36
May be it will help you.It is a simple search form submission.
http://www.keyboardninja.eu/webdevelopment/a-simple-search-with-angularjs-and-php
http://devzone.co.in/angularjs-simple-example-post-data-php-page/
Upvotes: 0
Reputation: 1219
You can do it making in PHP a couple of RESTfull services for the CRUD operation, for this you can use a Framework like Slim.
Then in AngularJs you can make a service like this for access the data:
app.factory('phoneService', ['$resource',
function ($resource) {
return $resource('../app/phone/:id',{id : '@id'},
{ 'findOne': { method: 'GET', params : {id : '@id'}}, isArray:false },
{ 'delete' : { method: 'DELETE', params : {id : '@id'}}, isArray: false },
{ 'save' : {method: 'POST', params : {id : '@id'}}, isArray: false }
);
}
]);
Upvotes: 1