Example Symfony and AngularJS demonstrating qandidate/symfony-json-request-transformer
- Clone this repository.
- Run
composer install
- Run
bower install
- Run
app/console server:run --env=dev -vvv
to start the server
Point your browser to http://localhost:8000/angular.html
You will see the AngularJS app performing two requests. One is a GET request, the other a POST request. In the DefaultController you will see the JSON POST request is automatically decoded and its properties are easily accessible in the Request object.
The magic happens in the JsonRequestTransformerListener which is tagged as a
kernel.event_listener
in services.xml