How to enable PouchDB Debug in Angular










1















I am developing a prototype web application. I used Yeoman to create an Angular application with Grunt, NPM, and Bower etc. The PouchDB API says you can enable debugging like so:



PouchDB.debug.enable('*');


This however requires the node debug module to be installed. I have tried installing it via bower and referencing it in my index.html but to no avail. How do I inject the debug module into Angular? Or is this function only available when the PouchDB is ran from a Node.js server?



EDIT:



The exact error I am getting is bellow. The line it complains about is: PouchDB.debug.enable('*');



TypeError: Cannot read property 'enable' of undefined
at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
at http://localhost:9000/bower_components/angular/angular.js:3947:37
at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13)
angular.js:11413 TypeError: Cannot read property 'enable' of undefined
at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
at http://localhost:9000/bower_components/angular/angular.js:3947:37
at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
at invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13) <div ng-view="" class="ng-scope">









share|improve this question




























    1















    I am developing a prototype web application. I used Yeoman to create an Angular application with Grunt, NPM, and Bower etc. The PouchDB API says you can enable debugging like so:



    PouchDB.debug.enable('*');


    This however requires the node debug module to be installed. I have tried installing it via bower and referencing it in my index.html but to no avail. How do I inject the debug module into Angular? Or is this function only available when the PouchDB is ran from a Node.js server?



    EDIT:



    The exact error I am getting is bellow. The line it complains about is: PouchDB.debug.enable('*');



    TypeError: Cannot read property 'enable' of undefined
    at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
    at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
    at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
    at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
    at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
    at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
    at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
    at http://localhost:9000/bower_components/angular/angular.js:3947:37
    at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
    at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13)
    angular.js:11413 TypeError: Cannot read property 'enable' of undefined
    at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
    at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
    at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
    at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
    at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
    at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
    at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
    at http://localhost:9000/bower_components/angular/angular.js:3947:37
    at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
    at invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13) <div ng-view="" class="ng-scope">









    share|improve this question


























      1












      1








      1








      I am developing a prototype web application. I used Yeoman to create an Angular application with Grunt, NPM, and Bower etc. The PouchDB API says you can enable debugging like so:



      PouchDB.debug.enable('*');


      This however requires the node debug module to be installed. I have tried installing it via bower and referencing it in my index.html but to no avail. How do I inject the debug module into Angular? Or is this function only available when the PouchDB is ran from a Node.js server?



      EDIT:



      The exact error I am getting is bellow. The line it complains about is: PouchDB.debug.enable('*');



      TypeError: Cannot read property 'enable' of undefined
      at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
      at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
      at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at http://localhost:9000/bower_components/angular/angular.js:3947:37
      at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13)
      angular.js:11413 TypeError: Cannot read property 'enable' of undefined
      at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
      at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
      at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at http://localhost:9000/bower_components/angular/angular.js:3947:37
      at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
      at invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13) <div ng-view="" class="ng-scope">









      share|improve this question
















      I am developing a prototype web application. I used Yeoman to create an Angular application with Grunt, NPM, and Bower etc. The PouchDB API says you can enable debugging like so:



      PouchDB.debug.enable('*');


      This however requires the node debug module to be installed. I have tried installing it via bower and referencing it in my index.html but to no avail. How do I inject the debug module into Angular? Or is this function only available when the PouchDB is ran from a Node.js server?



      EDIT:



      The exact error I am getting is bellow. The line it complains about is: PouchDB.debug.enable('*');



      TypeError: Cannot read property 'enable' of undefined
      at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
      at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
      at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at http://localhost:9000/bower_components/angular/angular.js:3947:37
      at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13)
      angular.js:11413 TypeError: Cannot read property 'enable' of undefined
      at new <anonymous> (http://localhost:9000/scripts/services/taskdb.js:13:15)
      at invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:4140:23)
      at Object.<anonymous> (http://localhost:9000/bower_components/angular/angular.js:3998:24)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at Object.enforcedReturnValue [as $get] (http://localhost:9000/bower_components/angular/angular.js:3982:37)
      at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4129:17)
      at http://localhost:9000/bower_components/angular/angular.js:3947:37
      at getService (http://localhost:9000/bower_components/angular/angular.js:4088:39)
      at invoke (http://localhost:9000/bower_components/angular/angular.js:4120:13) <div ng-view="" class="ng-scope">






      javascript angularjs pouchdb node-debugger






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 5 '14 at 14:37







      Connel

















      asked Dec 4 '14 at 14:55









      ConnelConnel

      1,07341432




      1,07341432






















          2 Answers
          2






          active

          oldest

          votes


















          3














          When you use PouchDB, the debug module is already installed. You don't need to do anything except call PouchDB.debug.enable('*'). :)






          share|improve this answer























          • Thanks for the reply, I must be doing something wrong then as it still doesn't work. I have updated my question.

            – Connel
            Dec 5 '14 at 14:32












          • Ah okay, I see now. Debugging is only available in PouchDB 3.2.0+!

            – nlawson
            Dec 7 '14 at 18:12


















          0














          Note that in PouchDB v7.0.0 loading a separate plugin is required for this.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f27297064%2fhow-to-enable-pouchdb-debug-in-angular%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            When you use PouchDB, the debug module is already installed. You don't need to do anything except call PouchDB.debug.enable('*'). :)






            share|improve this answer























            • Thanks for the reply, I must be doing something wrong then as it still doesn't work. I have updated my question.

              – Connel
              Dec 5 '14 at 14:32












            • Ah okay, I see now. Debugging is only available in PouchDB 3.2.0+!

              – nlawson
              Dec 7 '14 at 18:12















            3














            When you use PouchDB, the debug module is already installed. You don't need to do anything except call PouchDB.debug.enable('*'). :)






            share|improve this answer























            • Thanks for the reply, I must be doing something wrong then as it still doesn't work. I have updated my question.

              – Connel
              Dec 5 '14 at 14:32












            • Ah okay, I see now. Debugging is only available in PouchDB 3.2.0+!

              – nlawson
              Dec 7 '14 at 18:12













            3












            3








            3







            When you use PouchDB, the debug module is already installed. You don't need to do anything except call PouchDB.debug.enable('*'). :)






            share|improve this answer













            When you use PouchDB, the debug module is already installed. You don't need to do anything except call PouchDB.debug.enable('*'). :)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 5 '14 at 0:58









            nlawsonnlawson

            9,93212242




            9,93212242












            • Thanks for the reply, I must be doing something wrong then as it still doesn't work. I have updated my question.

              – Connel
              Dec 5 '14 at 14:32












            • Ah okay, I see now. Debugging is only available in PouchDB 3.2.0+!

              – nlawson
              Dec 7 '14 at 18:12

















            • Thanks for the reply, I must be doing something wrong then as it still doesn't work. I have updated my question.

              – Connel
              Dec 5 '14 at 14:32












            • Ah okay, I see now. Debugging is only available in PouchDB 3.2.0+!

              – nlawson
              Dec 7 '14 at 18:12
















            Thanks for the reply, I must be doing something wrong then as it still doesn't work. I have updated my question.

            – Connel
            Dec 5 '14 at 14:32






            Thanks for the reply, I must be doing something wrong then as it still doesn't work. I have updated my question.

            – Connel
            Dec 5 '14 at 14:32














            Ah okay, I see now. Debugging is only available in PouchDB 3.2.0+!

            – nlawson
            Dec 7 '14 at 18:12





            Ah okay, I see now. Debugging is only available in PouchDB 3.2.0+!

            – nlawson
            Dec 7 '14 at 18:12













            0














            Note that in PouchDB v7.0.0 loading a separate plugin is required for this.






            share|improve this answer



























              0














              Note that in PouchDB v7.0.0 loading a separate plugin is required for this.






              share|improve this answer

























                0












                0








                0







                Note that in PouchDB v7.0.0 loading a separate plugin is required for this.






                share|improve this answer













                Note that in PouchDB v7.0.0 loading a separate plugin is required for this.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 13 '18 at 17:13









                iX3iX3

                4,86232753




                4,86232753



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f27297064%2fhow-to-enable-pouchdb-debug-in-angular%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    What does pagestruct do in Eviews?

                    Dutch intervention in Lombok and Karangasem

                    Channel Islands