title: angular-pouchdb: pouchDB is not defined or is not a function
body: <p>I've installed this library in my angular app : <a href="https://github.com/angular-pouchdb/angular-pouchdb" rel="nofollow">https://github.com/angular-pouchdb/angular-pouchdb</a> (using <code>ionic add angular-pouchdb</code>).</p>
  
  <p>But I get this error: <code>Uncaught ReferenceError: pouchDB is not defined</code> when I tried to declare a factory that instanciates the database. See my code below.</p>
  
  <p>Module injection in app.js:</p>
  
  <pre><code>angular.module('BoardLine', ['ionic', 'ngCookies', 'ui.unique', 'pouchdb', 'BoardLine.controllers', 'BoardLine.services', 'BoardLine.filters'])
  </code></pre>
  
  <p>Factory in services.js to make the database available everywhere in the app:</p>
  
  <pre><code>.factory('usersDatabase', [ function(pouchdb) {
      var usersDatabase = pouchDB('boardline_users');
      var remote = 'https://louisromain:bingin/*@louisromain.cloudant.com/boardline_users';
      var opts = {live: true,
                  retry: true};
      usersDatabase.replicate.to(remote, opts);
      usersDatabase.replicate.from(remote, opts);
      //console.log(usersDatabase);
      return usersDatabase;
  }])
  </code></pre>
  
  <p>Srcipt call in index.html:</p>
  
  <pre><code>&lt;script src="lib/angular-pouchdb/angular-pouchdb.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Nota: If I write <code>.factory('usersDatabase', [ function(pouchDB) {</code> instead (uppercase DB instead of lowercase db),
  I get this error: <code>Uncaught TypeError: pouchDB is not a function</code>.</p>