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

share/nitweb/javascripts/metrics.js
share/nitweb/javascripts/model.js

index 9698e81..5fbad99 100644 (file)
 
 (function() {
        angular
-               .module('metrics', ['model'])
+               .module('metrics', [])
+
+               .factory('Metrics', [ '$http', function($http) {
+                       return {
+                               loadStructuralMetrics: function(id, cb, cbErr) {
+                                       $http.get('/api/metrics/structural/' + id)
+                                               .success(cb)
+                                               .error(cbErr);
+                               }
+                       }
+               }])
 
                .directive('metricsList', function() {
                        return {
index cf50c39..0792766 100644 (file)
 
        angular
                .module('model', [])
-
-               .factory('Metrics', [ '$http', function($http) {
-                       return {
-                               loadStructuralMetrics: function(id, cb, cbErr) {
-                                       $http.get(apiUrl + '/metrics/structural/' + id)
-                                               .success(cb)
-                                               .error(cbErr);
-                               }
-                       }
-               }])
 })();