nitweb: move users model to users module
authorAlexandre Terrasa <alexandre@moz-code.org>
Fri, 9 Jun 2017 18:51:46 +0000 (14:51 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Fri, 9 Jun 2017 18:51:46 +0000 (14:51 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

share/nitweb/javascripts/model.js
share/nitweb/javascripts/users.js

index 4078ac2..cf50c39 100644 (file)
                                }
                        }
                }])
-
-               .factory('User', [ '$http', function($http) {
-                       return {
-                               loadUser: function(cb, cbErr) {
-                                       $http.get(apiUrl + '/user')
-                                               .success(cb)
-                                               .error(cbErr);
-                               },
-                               loadUserStars: function(cb, cbErr) {
-                                       $http.get(apiUrl + '/feedback/user/stars')
-                                               .success(cb)
-                                               .error(cbErr);
-                               },
-                       }
-               }])
 })();
index 9e35858..c148bbe 100644 (file)
@@ -16,7 +16,7 @@
 
 (function() {
        angular
-               .module('users', ['ngSanitize', 'model'])
+               .module('users', ['ngSanitize'])
 
                .config(function($stateProvider, $locationProvider) {
                        $stateProvider
                                })
                })
 
+               .factory('User', [ '$http', function($http) {
+                       return {
+                               loadUser: function(cb, cbErr) {
+                                       $http.get('/api/user')
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+                               loadUserStars: function(cb, cbErr) {
+                                       $http.get('/api/feedback/user/stars')
+                                               .success(cb)
+                                               .error(cbErr);
+                               },
+                       }
+               }])
+
                .controller('UserCtrl', ['User', '$scope', function(User, $scope) {
                        this.loadUser = function() {
                                User.loadUser(