rails active model analogy in angular.js