Building an app using Ionic 2 and trying to incorporate the ble-plugin
. Following the installation steps:
$ cordova plugin add cordova-plugin-ble-central
In my page's TS, I included the following code:
import {Page, Alert, NavController} from 'ionic-angular';
@Page({
templateUrl: 'build/pages/hello-ionic/hello-ionic.html'
})
export class HelloIonicPage {
constructor(public nav: NavController) { }
bleScan() {
ble.scan([], 5, function(device) {
console.log(JSON.stringify(device));
}, failure);
}
}
Encountering errors as ble
is not being recognized. Wondering if a dependency needs to be injected or any other steps to make this work?