//app.js angular.module('ratewatcher', ['ngResource']). config(function($routeProvider) { $routeProvider. when('/lenders', {controller:LenderListController, templateUrl:'lender-list.html'}). when('/lenders/new', {controller:LenderCreateController, templateUrl:'lender-detail.html'}). when('/lenders/:id', {controller:LenderEditController, templateUrl:'lender-detail.html'}). otherwise({redirectTo:'/lenders'}); }). factory('Lender', function($resource) { return $resource('/lenders/:id', {id: '@id'}, {}); }); //controllers.js function LenderListController($scope, Lender) { $scope.lenders = Lender.query(); $scope.remove = function(lender) { lender.$remove(); } } function LenderCreateController($scope, Lender) { $scope.save = function() { var lender = new Lender({id: 0, name: $scope.lender.name, category: $scope.lender.category, url: $scope.lender.url }); lender.$save(); }; } function LenderEditController($scope, $location, $routeParams, Lender) { $scope.lender = Lender.get({id: $routeParams.id}); $scope.save = function() { $scope.lender.$save(); $location.path('/'); }; }I thought the scala backend was really concise, but it turns you can also make the front end javascript just as concise. Coupled with bootstrap css and basic html, this seems pretty good.
Suggested readings:
http://www.angularjs.org/ - Wire Up a Backend example
http://docs.angularjs.org/api/ngResource.$resource
http://jsfiddle.net/johnlindquist/qmNvq/
http://docs.angularjs.org/api/ng.$route