Separating Angularjs and Rails apps as standalone components

angularjs, ruby-on-rails

Solution

You could use a grunt based workflow:

- How to manage AngularJS workflow with lots of script files

- http://newtriks.com/2013/06/11/automating-angularjs-with-yeoman-grunt-and-bower/

If you start with a decoupled frontend, use mocks at first so you can stay within angular and not lose focus switching between backend and frontend logic. An advantage of building a single page application is that you can develop it independently of the backend api. See (http://docs.angularjs.org/api/ngMockE2E.$httpBackend) for information about mocking http responses.

Problem

I wanted to try out Angularjs. However, I have been trouble deciding on where I should located my angular app. I am using Rails framework for the backend. I have seen tutorials where the entire angular app lives under the assets/javascript folder. I was wondering if instead of living within the assets/javascript folder, I could make it live outside my rails directory entirely. That way, I can potentially separate my backend and front end entirely. (Is this recommended?). I believe the asset pipeline also precompiles a lot of the assets. If I were to separate out the angularjs asset, would I need to precompile the assets somehow? Thanks

Original source

Related problems