分叉插件 Ionic

Fork plugin Ionic

我想 fork barcode-scanner 插件来做自定义相机覆盖并在我的应用程序中使用它,但我不知道如何正确地做。

这是我的步骤...

1 - 我下载了

的主分支

https://github.com/phonegap/phonegap-plugin-barcodescanner

2 - 我将它复制并粘贴到插件文件夹中

3 - 我是这样添加到项目中的。

ionic Cordova 插件添加 'plugins/custom-barcodescanner'

4 - 我将它导入我的 app.module.ts

从'../../plugins/custom-barcodescanner'导入{BarcodeScanner};

结果:找不到模块.....custom-barcodescanner'

感谢您的帮助。

您应该将插件添加到不同于项目所在的文件夹,然后将其添加为 本地插件。这可以这样做:

ionic cordova plugin add /path/to/pluginfolder

另一种方法是在 github 上分叉插件并将您的更改添加到 github 分叉。然后将此存储库添加为插件:

ionic cordova plugin add https://github.com/path/to/your/fork