W3Cschool
恭喜您成為首批注冊用戶
獲得88經驗值獎勵
npm install fundebug-javascript --save
修改app.module.ts
import { ErrorHandler } from '@angular/core';
var fundebug: any = require("fundebug-javascript");
fundebug.apikey = 'API-KEY';
// 定義FundebugErrorHandler
export class FundebugErrorHandler implements ErrorHandler {
handleError(err:any) : void {
fundebug.notifyError(err);
}
}
// 使用FundebugErrorHandler
@NgModule({
// 其他代碼
providers: [ { provide: ErrorHandler, useClass: FundebugErrorHandler } ]
})
其中,獲取apikey需要免費注冊帳號并且創(chuàng)建項目。
如果您使用SystemJS, 那么需要為fundebug-javascript需要配置相應的路徑才能成功。
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
/* ... 其他配置 ...*/
// other libraries
/* ... 其他配置 ...*/
'fundebug-javascript': 'npm:fundebug-javascript/release/fundebug.x.x.x.min.js'
},
});
注意: fundebug.x.x.x.min.js中的x.x.x要改為插件的版本號,例如fundebug.0.3.1.min.js。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: