Javascript 如何在爱奥尼亚2项目中实施NfcvService?现在我得到了一些错误
我使用“cordova nfcv plugin/ionic2”中的Javascript 如何在爱奥尼亚2项目中实施NfcvService?现在我得到了一些错误,javascript,typescript,ionic-framework,ionic2,ionic3,Javascript,Typescript,Ionic Framework,Ionic2,Ionic3,我使用“cordova nfcv plugin/ionic2”中的import{NfcvService}实现我的ionic项目的NFC模块 我在conlose上发现了这个错误, 仅供参考,请确保已导入NFC应用程序内模块和当前组件 这里有一个例子 import {NfcvService} from 'cordova-nfc-plugin/ionic2'; @NgModule({ providers: [ NfcvService ] }) export class AppModu
import{NfcvService}实现我的ionic项目的NFC模块代码>
我在conlose上发现了这个错误,
仅供参考,请确保已导入NFC应用程序内模块和当前组件
这里有一个例子
import {NfcvService} from 'cordova-nfc-plugin/ionic2';
@NgModule({
providers: [
NfcvService
]
})
export class AppModule {}
app.component.ts
import { NfcvService } from 'cordova-nfc-plugin/ionic2';
constructor(public nfcvService: NfcvService) {
nfcvService.addNdefListener();
}
ngOnInit() {
this.nfcvService.onTag().subscribe((tag) => {
//Avoid reading null tag on first call
if (tag) {
console.log('Found tag:', tag);
this.tag = tag; // here you can use variable further
}
});
}
我希望它能解决你的问题
如需更多参考,请访问此处的网站
谢谢您的回答,但ı根据文档应用了这些步骤。显示您使用的组件文件?。