在app.module.ts中添加插件时出错

时间:2019-01-26 08:05:46

标签: ionic-framework plugins camera ionic-native

每当我尝试在ionic中添加PhotoLibrary插件时,都无法在app.module.ts中添加它。我收到以下错误

Type 'PhotoLibraryOriginal' is not assignable to type 'Provider'.
  Type 'PhotoLibraryOriginal' is missing the following properties from type 'FactoryProvider': provide, useFactory [2322]
(alias) const PhotoLibrary: PhotoLibraryOriginal
import PhotoLibrary

请检查下图以获取完整错误。

enter image description here

1 个答案:

答案 0 :(得分:1)

/ngx导入与ionic-angular应用一起使用的所有最新离子本机插件...

import { PhotoLibrary } from '@ionic-native/photo-library/ngx';

其他版本回退到插件的版本4。*