title: Angular JS Injecting Custom Service
body: <p>I can't get angular to accept my custom service, which is in a seperate file. I know this is all over stack overflow, but I just can't tell where I'm messing up.</p>
  
  <p>Html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" ng-app="angularApp"&gt;
  &lt;head&gt;
    &lt;!-- ANGULAR --&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"&gt;&lt;/script&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular-sanitize.js"&gt;&lt;/script&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-route.js"&gt;&lt;/script&gt;
    &lt;link href="styles/angularApp.css" rel="stylesheet"&gt;
    &lt;script src="scripts/controllers/angularApp.js"&gt;&lt;/script&gt;
    &lt;script src ="scripts/services/clearCodemirror.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Main angular javascript file (contains my controller)</p>
  
  <pre><code>var myApp = angular.module("angularApp", ["ui.codemirror","ui.bootstrap", "ngSanitize", "ngRoute"]);
  
  myApp.controller("mainController", ["$scope", "$timeout", "clearCodemirror", function($scope, $timeout, clearCodemirror){
  </code></pre>
  
  <p>Service I'm trying to inject: </p>
  
  <pre><code>var myApp = angular.module("angularApp");
  
  myApp.service("clearCodemirror", function(cm){
  </code></pre>
  
  <p>Error I keep getting:</p>
  
  <pre><code>Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.6/$injector/modulerr?p0=angularApp&amp;p1=Error…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.6%2Fangular.min.js%3A29%3A56)
  </code></pre>
  
  <p>I only included the beginnings of each file so you guys wouldn't have to wade through tons of code. Where am I screwing up?</p>
  
  <p>Thanks!</p>