Configure angular with php server

-1

I need to set the angle to send data to php?

I noticed that in the file: C: \ wamp \ www \ angular \ bower_components \ angular \ angular.js

have server settings, methods, etc.

    
asked by anonymous 13.08.2015 / 15:41

3 answers

1

The best way to communicate with back-end servers (your PHP application) using AngularJS is by using $ http.

You could give a better look at AngularJS, and RESTful.

For AngularJS study the Codeschool course, for RESTful look for frameworks in PHP which abstract the heavy work of implementation.

Good luck !!

    
11.09.2015 / 14:53
2

You can send the data to php using $ http.post or $ http.get.

    .controller('BuscaCtrl',function($scope,$http) {
            // Faz a busca no php
            $http.get('<caminho do arquivo .php>')
            .success(function(data){
                    // Pega os dados recebidos do php
                    console.log(data);
            });
    });
    
13.08.2015 / 22:03
1

You can also use the angular-resource ($ resource) is a separate file from angular.js, it does what $ http does in a more elegant way!

link $ resource

    
24.01.2016 / 00:01