ionic-native / contacts - 找不到名称ContactField

时间:2017-10-06 19:32:12

标签: ionic-framework angular2-components

尝试在离子中创建函数that accesses a users contacts时,我收到以下错误

enter image description here

在app.module我有

import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts';

....
...
@NgModule({

..
providers: [
    Contacts,
    Contact,
    ContactField,
    ContactName
]
})
export class AppModule { }

也在我的联系人组件中导入

contacts.component.ts

import { Contacts, Contact, ContactField, ContactName } from '@ionic-native/contacts';

我做错了什么?

1 个答案:

答案 0 :(得分:0)

当我更新项目的离子版本时,此问题已解决。

npm install -g ionic@latest