I'm designing a small app which would have a couple of independent pages. I'm planning to use angular for the front end and I need an SQL database on the backend.
I'm not really designing a web application, but a in-house systeme, using (cheap) mobile phone for operators tasks (a kind of todo list for each operator) and supervisor page on a desktop which is used to assigned tasks to operators.
There is at the moment 3 different pages:
1- the mobile todo list
2- the administrator scheduling page
3- administrator report and stats.
Only the first one needs angular, the 2 other could be done as a standard web app, but I'll prefer to use angular if possible.
I'm thinking of either using Rails (only because I know it) to read/write from the database and export/import json to the angular pages. However it doesn't solve the problem of how to do a multiple pages angular application ? All the pages even though different angular "views" will probably share the same components. I would like to avoid using angular routing because I'm using cheap and slow mobile for the todo-like, so I don't want it to be overloaded with things it doesn't need.
I'm also using yeoman, not sure is the best choice as it seems to manage single page application. Maybe I need to have one yeoman project per view ???
So what is the best practice to have a rail application to host different angular pages ?
Also if there is an easier way to serve sql directly to angular, I can use something different that rail.
In my Rails/Angular apps, I use $resource to RESTfully get/put data within the RoR created database. Here are the docs for $resource.
http://docs.angularjs.org/api/ngResource.$resource
Here is an example how I did it in a resume web app i am building for myself.
app = angular.module("Resume", ["ngResource"])
app.factory "Entry", ["$resource", ($resource) ->
$resource("/entries")
]
@EntryCtrl = ["$scope", "Entry", ($scope, Entry) ->
$scope.entries = Entry.query()
$scope.showThis = false
$scope.isClass = (isProject) ->
if isProject == true
$scope.myVar = "project alert-info"
else
$scope.myVar = "tech alert-success"
]
*The coffeescript functions are in array's to protect them from compiling.
**This code is similar to how Ryan Bates examples at Railscasts.com