@gassense wrote:
I am creating an app with ionic 2 and am trying to work with the
ble-plugin
. I ran the installation:$ cordova plugin add cordova-plugin-ble-central
then wrote the following in my page's TS:
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); } }
However,
ble
isn't recognised so my code is throwing errors. Do I need to inject a dependancy or something, why isn't this working?
Posts: 1
Participants: 1