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

share/nitweb/javascripts/docdown.js
share/nitweb/javascripts/model.js

index 0095c81..2b96d19 100644 (file)
@@ -16,7 +16,7 @@
 
 (function() {
        angular
-               .module('docdown', ['model', 'ngSanitize'])
+               .module('docdown', ['ngSanitize'])
 
                .config(function($stateProvider, $locationProvider) {
                        $stateProvider
                                })
                })
 
+               .factory('DocDown', [ '$http', function($http) {
+                       return {
+                               postMarkdown: function(md, cb, cbErr) {
+                                       $http.post('/api/docdown', md)
+                                               .success(cb)
+                                               .error(cbErr);
+                               }
+                       }
+               }])
+
                .controller('DocdownCtrl', ['$sce', '$scope', '$location', 'DocDown', function($sce, $scope, $location, DocDown) {
 
                        this.updateSnippet = function() {
index eaa86b5..13f5e7f 100644 (file)
                        }
                }])
 
-               .factory('DocDown', [ '$http', function($http) {
-                       return {
-                               postMarkdown: function(md, cb, cbErr) {
-                                       $http.post(apiUrl + '/docdown', md)
-                                               .success(cb)
-                                               .error(cbErr);
-                               }
-                       }
-               }])
-
                .factory('Metrics', [ '$http', function($http) {
                        return {
                                loadStructuralMetrics: function(id, cb, cbErr) {