【发布时间】:2019-05-21 02:00:48
【问题描述】:
我正在按照 Ionic v3 应用程序的视频教程使用 Ionic Native Keyboard,由于教程中使用的本机键盘版本和 Ionic 文档中可用的当前版本发生了变化,这似乎是一个错误。当前版本 --> https://ionicframework.com/docs/native/native-keyboard
旧版本使用稍微不同的导入方法。因此,当我在 .ts 文件的构造中声明 本机键盘 并运行控制台日志以检查它是否正常运行时,我收到了一个错误:
**.ts 文件:**
import { NativeKeyboard } from '@ionic-native/native-keyboard/ngx';
constructor(
...
private nativeKeyboard: NativeKeyboard
) {
//Here comes the error:
this.nativeKeyboard.onKeyboardShow().subscribe(() =>{
console.log('keyboard openned')
})
}
错误信息:
我该怎么办?
【问题讨论】: