Explorar el Código

Port notes factory to service

Lily Carpenter hace 10 años
padre
commit
d517653c3c
Se han modificado 1 ficheros con 4 adiciones y 6 borrados
  1. 4 6
      www/js/services/notes.js

+ 4 - 6
www/js/services/notes.js

@@ -1,5 +1,5 @@
1 1
 angular.module('bootcampApp')
2
-  .factory('Notes', function(){
2
+  .service('Notes', function(){
3 3
     function cloneNote(note){
4 4
       var my_note = {};
5 5
       my_note.body = note.body;
@@ -17,9 +17,7 @@ angular.module('bootcampApp')
17 17
       return angular.fromJson(data);
18 18
     }
19 19
 
20
-    return {
21
-      cloneNote: cloneNote,
22
-      saveData: saveData,
23
-      getData: getData
24
-    };
20
+    this.cloneNote = cloneNote;
21
+    this.saveData = saveData;
22
+    this.getData = getData;
25 23
   });