Commits

Endy Muhardin committed 3018e1c

fix relative url

  • Participants
  • Parent commits cd3c72b

Comments (0)

Files changed (2)

belajar-restful-web/src/main/webapp/js/aplikasi-controller.js

     }])
     .controller('MenubarController', ['$http', '$scope', function($http, $scope){
         $scope.userinfo = {};
-        $http.get('/homepage/userinfo').success(function(data){
+        $http.get('homepage/userinfo').success(function(data){
             $scope.userinfo = data;
         });
     }])
     .controller('AboutController', ['$http', '$scope', function($http, $scope){
         $scope.appinfo = {};
-        $http.get('/homepage/appinfo').success(function(data){
+        $http.get('homepage/appinfo').success(function(data){
             $scope.appinfo = data;
         });
     }])

belajar-restful-web/src/main/webapp/js/aplikasi-service.js

 angular.module('belajar.service', ['ngResource'])
     .factory('ApplicationConfigService', ['$resource', '$http', function($resource, $http){
         var service = {
-            applicationConfig: $resource('/config/:configId'),
+            applicationConfig: $resource('config/:configId'),
             get: function(param, callback){ return this.applicationConfig.get(param, callback) }, 
             query: function(){ return this.applicationConfig.query() },
             save: function(obj){
                 if(obj.id == null){
-                    return $http.post('/config', obj);
+                    return $http.post('config', obj);
                 } else {
-                    return $http.put('/config/'+obj.id, obj);
+                    return $http.put('config/'+obj.id, obj);
                 }
             }, 
             remove: function(obj){
                 if(obj.id != null){
-                    return $http.delete('/config/'+obj.id);
+                    return $http.delete('config/'+obj.id);
                 }
             }
         };
     .factory('ApplicationSessionsService', ['$http', function($http){
         var service = {
             list: function(){ 
-                return $http.get('/homepage/sessioninfo');
+                return $http.get('homepage/sessioninfo');
             }, 
             kick: function(user){
-                return $http.delete('/homepage/kick/'+user.sessionid);
+                return $http.delete('homepage/kick/'+user.sessionid);
             }
         };
             
     }])
     .factory('SystemMenuService', ['$resource', '$http', function($resource, $http){
         var service = {
-            menu: $resource('/menu/:id', {}, {
+            menu: $resource('menu/:id', {}, {
                 queryPage: {method:'GET', isArray: false}
             }),
             get: function(param, callback){ return this.menu.get(param, callback) }, 
             query: function(p, callback){ return this.menu.queryPage({"page.page": p, "page.size": 10}, callback) },
             save: function(obj){
                 if(obj.id == null){
-                    return $http.post('/menu', obj);
+                    return $http.post('menu', obj);
                 } else {
-                    return $http.put('/menu/'+obj.id, obj);
+                    return $http.put('menu/'+obj.id, obj);
                 }
             }, 
             remove: function(obj){
                 if(obj.id != null){
-                    return $http.delete('/menu/'+obj.id);
+                    return $http.delete('menu/'+obj.id);
                 }
             }
         };
     }])
     .factory('PermissionService', ['$resource', '$http', function($resource, $http){
         var service = {
-            permission: $resource('/permission/:id'),
+            permission: $resource('permission/:id'),
             get: function(param, callback){ return this.permission.get(param, callback) }, 
             query: function(){ return this.permission.query() },
             save: function(obj){
                 if(obj.id == null){
-                    return $http.post('/permission', obj);
+                    return $http.post('permission', obj);
                 } else {
-                    return $http.put('/permission/'+obj.id, obj);
+                    return $http.put('permission/'+obj.id, obj);
                 }
             }, 
             remove: function(obj){
                 if(obj.id != null){
-                    return $http.delete('/permission/'+obj.id);
+                    return $http.delete('permission/'+obj.id);
                 }
             }
         };
     }])
     .factory('RoleService', ['$resource', '$http', function($resource, $http){
         var service = {
-            role: $resource('/role/:id'),
+            role: $resource('role/:id'),
             get: function(param, callback){ return this.role.get(param, callback) }, 
             query: function(){ return this.role.query() },
             save: function(obj){
                 if(obj.id == null){
-                    return $http.post('/role', obj);
+                    return $http.post('role', obj);
                 } else {
-                    return $http.put('/role/'+obj.id, obj);
+                    return $http.put('role/'+obj.id, obj);
                 }
             }, 
             remove: function(obj){
                 if(obj.id != null){
-                    return $http.delete('/role/'+obj.id);
+                    return $http.delete('role/'+obj.id);
                 }
             },
             unselectedPermission: function(obj){
-                return $http.get('/role/'+obj.id+'/unselected-permission');
+                return $http.get('role/'+obj.id+'/unselected-permission');
             },
             unselectedMenu: function(obj){
-                return $http.get('/role/'+obj.id+'/unselected-menu');
+                return $http.get('role/'+obj.id+'/unselected-menu');
             }
         };
             
     }])
     .factory('UserService', ['$resource', '$http', function($resource, $http){
         var service = {
-            user: $resource('/user/:id'),
+            user: $resource('user/:id'),
             get: function(param, callback){ return this.user.get(param, callback) }, 
             query: function(){ return this.user.query() },
             save: function(obj){
                 if(obj.id == null){
-                    return $http.post('/user', obj);
+                    return $http.post('user', obj);
                 } else {
-                    return $http.put('/user/'+obj.id, obj);
+                    return $http.put('user/'+obj.id, obj);
                 }
             }, 
             remove: function(obj){
                 if(obj.id != null){
-                    return $http.delete('/user/'+obj.id);
+                    return $http.delete('user/'+obj.id);
                 }
             }
         };