{"id":16354195,"url":"https://github.com/beeman/angular-restangular-crud","last_synced_at":"2025-03-21T00:31:25.709Z","repository":{"id":14087658,"uuid":"16791517","full_name":"beeman/angular-restangular-crud","owner":"beeman","description":"A working implementation of a CRUD website made with AngularJS, Restangular and the Angular UI Router. It comes with an API that stores the objects in memory.","archived":false,"fork":false,"pushed_at":"2014-12-24T05:50:48.000Z","size":308,"stargazers_count":45,"open_issues_count":0,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-12T01:33:11.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/beeman.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":"2014-02-13T04:16:27.000Z","updated_at":"2023-08-22T13:04:50.000Z","dependencies_parsed_at":"2022-08-28T22:31:32.125Z","dependency_job_id":null,"html_url":"https://github.com/beeman/angular-restangular-crud","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/beeman%2Fangular-restangular-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeman%2Fangular-restangular-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeman%2Fangular-restangular-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beeman%2Fangular-restangular-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beeman","download_url":"https://codeload.github.com/beeman/angular-restangular-crud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221810422,"owners_count":16884114,"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-11T01:33:09.502Z","updated_at":"2024-10-28T08:56:13.154Z","avatar_url":"https://github.com/beeman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### If you like this my [new project](https://github.com/beeman/loopback-angular-admin) might be interesting too!\n\nIt uses loopback, angular, restangular and has support for user authentication, file uploads and other stuff :)\n\n# angular-restangular-crud\n\nExample of how to use restangular in a way that you DRY too much... \n\nIt uses AngularJS with Restangular at the frontend and loopback (https://www.npmjs.org/package/loopback) as the API.\n\nTo run it you need node/npm/grunt/bower (and maybe even more packages) installed...\n\n### Clone the repository\n\n    git clone https://github.com/beeman/angular-restangular-crud\n\n### Install the server and leave it running \n\n    cd angular-restangular-crud/api\n    npm install\n    node app.js # or nodemon app.js\n\n### Install the client\n\n    cd angular-restangular-crud/client\n    npm install \n    bower install\n    grunt\n\nGrunt might show some errors, most of the time it's jslint testing your JavaScript... Fix the errors or override them with --force.\n\n### Serve the page\n\n    grunt serve\n\nIf all went well you can now list/add/view and edit notes.\n\nYou can start working in the client directory and most of the changes will be picked up by autoreload (https://www.npmjs.org/package/livereload). Grunt serves the client on port 9000 and the API serves the same app at port 3000, but without the livereload.\n\nIt is trivial to create some more models and quickly crank out a simple scaffold, as show below. \n\n## Adding a new datatype to this example\n\nWe will add an object named 'Host' \n\nAdd menu item somewhere around line 30 in app/index.html:\n\n    \u003cli ui-sref-active=\"active\"\u003e\u003ca href='' ui-sref=\"hosts.list\"\u003eHosts\u003c/a\u003e\u003c/li\u003e\n\nCopy app/scripts/controllers/notes.js to app/scripts/controllers/hosts.js \n\n    $ cp app/scripts/controllers/notes.js app/scripts/controllers/hosts.js \n\nNow edit the new file and search and replace:\n\n    find app/scripts/controllers/hosts.js -type f -exec sed -i '' 's/note/host/g' {} \\;\n    find app/scripts/controllers/hosts.js -type f -exec sed -i '' 's/Note/Host/g' {} \\;\n\nCreate the views:\n\n    mkdir app/views/hosts/\n    cp app/views/notes/* app/views/hosts\n    \nNow edit these new files and search and replace:\n\n    find app/views/hosts/. -type f -exec sed -i '' 's/note/host/g' {} \\;\n    find app/views/hosts/. -type f -exec sed -i '' 's/Note/Host/g' {} \\;\n\nLast but certainly not least, register the new controller in your template:\n\nEdit app/index.html and the following line just before the 'endbuild' line \n\n    \u003cscript src=\"scripts/controllers/hosts.js\"\u003e\u003c/script\u003e\n\n\nUpdate the API to accept this datatype. Edit api/models.json and add the following code to the object array:\n\n    \"host\": {\n      \"public\": true,\n      \"dataSource\": \"db\",\n      \"plural\": \"hosts\"\n    }\n\nNow restart the API to start accepting the model abov..\n\n# Todo\n\n * Add easy DB configuration\n * You name it?\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Bram Borggreve\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeeman%2Fangular-restangular-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeeman%2Fangular-restangular-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeeman%2Fangular-restangular-crud/lists"}