title: AngularJS minError Uncaught Object
body: <p>I have a new AngularJS project I've just set up. I've installed <code>angular</code> and <code>angular-resource</code> via <code>bower</code> and all's good. I've installed another service I've used before - <a href="https://github.com/Fundoo-Solutions/angularjs-modal-service" rel="nofollow">https://github.com/Fundoo-Solutions/angularjs-modal-service</a> but when I inject the module it causes the error below:</p>
  
  <blockquote>
    <p>Uncaught object</p>
  </blockquote>
  
  <p>It's pointing to the return statement of this function in AngularJS:</p>
  
  <pre><code>function minErr(module) {
    return function () {
      var code = arguments[0],
        prefix = '[' + (module ? module + ':' : '') + code + '] ',
        template = arguments[1],
        templateArgs = arguments,
        stringify = function (obj) {
          if (typeof obj === 'function') {
            return obj.toString().replace(/ \{[\s\S]*$/, '');
          } else if (typeof obj === 'undefined') {
            return 'undefined';
          } else if (typeof obj !== 'string') {
            return JSON.stringify(obj);
          }
          return obj;
        },
        message, i;
  
      message = prefix + template.replace(/\{\d+\}/g, function (match) {
        var index = +match.slice(1, -1), arg;
  
        if (index + 2 &lt; templateArgs.length) {
          arg = templateArgs[index + 2];
          if (typeof arg === 'function') {
            return arg.toString().replace(/ ?\{[\s\S]*$/, '');
          } else if (typeof arg === 'undefined') {
            return 'undefined';
          } else if (typeof arg !== 'string') {
            return toJson(arg);
          }
          return arg;
        }
        return match;
      });
  
      message = message + '\nhttp://errors.angularjs.org/1.2.18/' +
        (module ? module + '/' : '') + code;
      for (i = 2; i &lt; arguments.length; i++) {
        message = message + (i == 2 ? '?' : '&amp;') + 'p' + (i-2) + '=' +
          encodeURIComponent(stringify(arguments[i]));
      }
  
      return new Error(message);
    };
  }
  </code></pre>
  
  <p>I think it's saying that <code>Error</code> doesn't exist?</p>
  
  <p>Am I missing a module or something?</p>