如何在 Angular 中启用 PouchDB Debug
How to enable PouchDB Debug in Angular
我正在开发一个原型Web应用程序。我使用Yeoman创建了一个带有Grunt,NPM和Bower等的Angular应用程序。PouchDB API 说你可以像这样启用调试:
PouchDB.debug.enable('*');
但是,这需要安装节点调试模块。我尝试通过 bower 安装它并在我的索引中引用它.html但无济于事。如何将调试模块注入 Angular 中?还是此功能仅在 PouchDB 从 Node.js 服务器运行时可用?
编辑:
我得到的确切错误是下面。它抱怨的台词是: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">
当您使用 PouchDB 时,调试模块已经安装。除了呼叫PouchDB.debug.enable('*')
之外,您无需执行任何操作。:)
请注意,在 PouchDB v7.0.0 中,需要加载一个单独的插件。
相关文章:
- 如何在读取XLS/XLSX本地文件时,使用IE的javascript代码启用未标记为安全的ActiveX控件
- 如何在 API 调用后和 if 语句中启用提交按钮
- 语义ui如何使用javascript启用或禁用下拉列表
- IE6在启用/禁用文本字段上闪烁
- 传单中如何在更改基层时启用/禁用覆盖层
- 根据字段的值启用按钮
- 如何使用javascript函数在gridview中按行启用/禁用复选框
- 如何禁用和启用css规则
- 淘汰赛.JS'启用'长度绑定条件不起作用
- 如何动态检测Mozilla/Chrome上是否启用SSO
- 旋转木马;启用内容安全策略时无法工作
- 如何从PouchDB导入/导出数据库
- 动态启用/禁用来自控制器的输入文本
- 如何启用单选按钮
- 检查浏览器'在asp.net的后端代码中启用或禁用了s JS
- 有关PouchDB的复杂startkey/endkey查询未返回预期结果
- jQuery根据用户选择启用/禁用asp.net控件
- 当我的所有 Ng-from 都有效时启用一个按钮
- 在Golang回调函数中启用CORS
- 如何在 Angular 中启用 PouchDB Debug