Javascript 如何在Angular中启用数据库调试
我正在开发一个原型web应用程序。我使用Yeoman创建了一个带有Grunt、NPM和Bower等的Angular应用程序。上面说您可以像这样启用调试:Javascript 如何在Angular中启用数据库调试,javascript,angularjs,pouchdb,node-debugger,Javascript,Angularjs,Pouchdb,Node Debugger,我正在开发一个原型web应用程序。我使用Yeoman创建了一个带有Grunt、NPM和Bower等的Angular应用程序。上面说您可以像这样启用调试: PouchDB.debug.enable('*'); 但是,这需要安装。我试着通过bower安装它,并在index.html中引用它,但没有用。如何将调试模块注入Angular?或者该功能仅在从Node.js服务器运行数据库时可用 编辑: 我得到的确切错误如下。它抱怨的行是:pockdb.debug.enable'*' 使用PockDB时,已
PouchDB.debug.enable('*');
但是,这需要安装。我试着通过bower安装它,并在index.html中引用它,但没有用。如何将调试模块注入Angular?或者该功能仅在从Node.js服务器运行数据库时可用
编辑:
我得到的确切错误如下。它抱怨的行是:pockdb.debug.enable'*'
使用PockDB时,已安装调试模块。除了调用db.debug.enable'*',您不需要执行任何操作: 使用PockDB时,调试模块已安装。除了调用db.debug.enable'*',您不需要执行任何操作: 请注意,这需要使用PockDB v7.0.0。请注意,这需要使用PockDB v7.0.0。感谢您的回复,我当时一定是做错了什么,因为它仍然不起作用。我已经更新了我的问题。啊,好的,我现在明白了。调试仅在DB3.2.0+中可用!谢谢你的回复,我一定是做错了什么,因为它仍然不起作用。我已经更新了我的问题。啊,好的,我现在明白了。调试仅在DB3.2.0+中可用!
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">