{"id":17458141,"url":"https://github.com/pocesar/angularjs-pheryjs","last_synced_at":"2025-04-02T21:29:58.510Z","repository":{"id":8598675,"uuid":"10235310","full_name":"pocesar/angularjs-pheryjs","owner":"pocesar","description":"Pretty simple phery.js AJAX service for AngularJS that mimics $resource","archived":false,"fork":false,"pushed_at":"2013-05-23T23:55:39.000Z","size":108,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T06:28:29.122Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pocesar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-23T03:44:17.000Z","updated_at":"2013-10-12T20:41:51.000Z","dependencies_parsed_at":"2022-08-27T17:01:46.725Z","dependency_job_id":null,"html_url":"https://github.com/pocesar/angularjs-pheryjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangularjs-pheryjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangularjs-pheryjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangularjs-pheryjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangularjs-pheryjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocesar","download_url":"https://codeload.github.com/pocesar/angularjs-pheryjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246895508,"owners_count":20851283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T03:55:18.749Z","updated_at":"2025-04-02T21:29:58.480Z","avatar_url":"https://github.com/pocesar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"angularjs-pheryjs\n=================\n\nPretty simple phery.js AJAX service for AngularJS that mimics $resource, for usage with PHP\n\nThis depends on phery.js library https://github.com/pocesar/phery\n\n### Usage\n\n```js\napp = angular.module('App', []);\n\napp.controller('YourController', function($scope, $pheryResource, $timeout){\n  far = $pheryResource('your-remote-function');\n  \n  /* If you want to reach the JSON callback, you need to return PheryResponse::factory()-\u003ejson($your_data) */\n  far['delete']({'id':1}, function(){ /*JSON*/ }, function(){ /*fail*/ }); //calls your-remote-function with DELETE method and id:1\n  far.get({'id':1}, function(){ /*JSON*/ }, function(){ /*fail*/ }); // calls your-remote-function with GET method and id:1\n  far.post($scope.model, function(){ /*JSON*/ }, function(){ /*fail*/ }); // calls your-remote-function with POST method and post the data from the model\n  far.put($scope.model, function(){ /*JSON*/ }, function(){ /*fail*/ }); // calls your-remote-function with PUT method and put the data from the model\n  \n  far.subscribe({ // subscribe, reach this by returning a PheryResponse::factory()-\u003epublish('load') or 'done' for example\n    'load': function(data){\n      $scope.model = data;\n    },\n    'done': function(){\n      $scope.modal.close();\n    }\n  });\n  \n  phery.broadcast('done'); // trigger the subscribed event everythere\n  far.publish('done'); // trigger the subscribed event only on this element\n  \n  far.remote([1,3,4]); // call the remote your-remote-function with any king of arguments directly\n  \n  far.proxy('div.load'); // proxy this detached element to another DOM element\n  \n  far.element.on('phery:retry', function(trycount){ // all phery events are available on the element member\n    $timeout(function(){\n      $scope.message = 'Retrying ' + trycount + '...';\n    });\n  });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fangularjs-pheryjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocesar%2Fangularjs-pheryjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fangularjs-pheryjs/lists"}