Rails models to angularjs framework