mimic Parse in AngularJS