I have successfully configured an AngularJS setup to collaborate with Symfony2 as the backend and AngularJS as the frontend. The structure I have implemented is as follows (using generator-symfony as the foundation):
/app
houses the standard Symfony2 application/grunt
contains the standard AngularJS scripts (similar to/app
when exclusively using AngularJS)/src
stores the Symfony2 source code/vendor
composer dependencies/web
serves as the main route for Symfony (includesapp.php
andapp_dev.php
)/web/dist
holds the distribution build for grunt (grunt build
)
I have directed http://localhost/
to the /grunt
directory and http://localhost/api
to the /web
directory, which is functioning well allowing me to access both the angular application and the Symfony2 application.
In my /grunt
directory, I created an index.html file with some HTML content, and everything works smoothly as expected, including accessing and refreshing the page.
However, the livereload feature seems to be not working. I made modifications to the Gruntfile.js
from the generator-symfony template I used (provided below). Any suggestions on what might be misconfigured?
(I would prefer to highlight only the relevant sections, but pinpointing the exact issue is challenging at the moment).
/**
* Gruntfile
* @see http://gruntjs.com/getting-started
*
* Plugin and task configuration for Grunt.
*
* Based on the yeoman webapp generator
* @see https://github.com/yeoman/generator-webapp
*/
// Enable strict mode
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// Grunt configurations go here...
};
If more details are required, feel free to inquire!