'use strict';

app.factory('DeviceService',
        ['$http', function ($http) {
                var service = {};
                
                service.FindDevice = function (callback) {
                    $http.get('/api/devices/')
                            .success(function (data, status) {
                                callback(data, status);
                            }).error(function(data, status){
                                callback(data, status);
                            });
                };
                
                return service;
            }
        ]);
@@ -108,32 +108,16 @@
 e = %7B%7D;%0A
-                
 %0A       
@@ -156,16 +156,20 @@
 nction (
+id, 
 callback
@@ -201,28 +201,167 @@
 http
-.get('/api/devices/'
+(%7B%0A                        url: '/api/users/:id/devices',%0A                        method: %22GET%22,%0A                        params: %7Bid: id%7D%0A                    %7D
 )%0A  
@@ -522,16 +522,17 @@
 function
+ 
 (data, s
@@ -537,26 +537,19 @@
  status)
+ 
 %7B%0A
-        
         
@@ -584,32 +584,24 @@
 a, status);%0A
-        
             
@@ -631,32 +631,16 @@
      %7D;%0A
-                
 %0A       

Ajuste Maps usando service compartilhado