12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- angular.module("noteWrangler")
-
- .factory('Note', ['$http', function NoteFactory($http) {
- return {
- all: function () {
- return $http({
- method: "GET",
- url: "/notes.json",
- });
- },
- find: function (id) {
- return $http({
- method: "GET",
- url: "/notes/" + id.toString(),
- });
- },
- create: function (noteObj) {
- return $http({
- method: "POST",
- url: "/notes",
- data: noteObj,
- });
- },
- update: function (nodeObj) {
- return $http({
- method: "PUT",
- url: "/notes",
- data: nodeObj,
- })
- },
- }
- }]);
|