3
How should this be done? Through REST, or there is another way?
You need to have an API (in most cases it is used REST but I’ve seen with SOAP) that will be consumed in your application Angular. Who will make the connection to database, business rule and the like will be the API, the application Angular will only worry about sending requests to the API.
Basically you will develop, maintain and publish the backend separate from your frontend.
About the development and consumption of REST Apis
Angular itself provides resources for consuming REST services, such as the service $http
and the ngResource
and there are some frameworks PHP that can help you developer your REST API as the Laravel and the Slim Framework.
One simple example of what it’s like to consume a REST API using $http
function HelloWorld($scope, $http) {
$http.get('http://restservice.com:1233/HelloWorld').
success(function(data) {
$scope.hello = data;
});
}
I also have this question. I do not know how to develop with angular, but I develop with back end and I need to know something about the angular to integrate with the back end.
– André Nascimento