title: Getting Bluetooth working in Ionic
body: <p>My first go with Ionic plugins. Got a PaypalHere pad machine I am trying to link up to my app, which uses Bluetooth. So will later need to enter a Mac address for that somewhere. But just need to get Bluetooth working first.</p>
  
  <p>I have installed Bluetooth using "cordova plugin add cordova-plugin-bluetooth-serial" 
  <a href="https://github.com/don/BluetoothSerial" rel="nofollow noreferrer">https://github.com/don/BluetoothSerial</a></p>
  
  <p>I originally installed npm inistall -g cordova but now see refs on tutorials to ngcordova?</p>
  
  <p>Can anyone help with what I need to add to my app.js file(controller) now to get a prompt that Bluetooth is working and fully enable Bluetooth?</p>
  
  <p>I assume i need to inject the service in the controller then run some function to perform a check.</p>
  
  <p>There is a post here but it doesn't seem to be complete
  <a href="https://stackoverflow.com/questions/30999759/bluetoothserial-plugin-is-not-working-with-ionic">BluetoothSerial plugin is not working with ionic</a></p>
  
  <p>Here is my app.js code:</p>
  
  <pre><code>// Ionic Starter App
  
  // angular.module is a global place for creating, registering and retrieving Angular modules
  // 'starter' is the name of this angular module example (also set in a &lt;body&gt; attribute in index.html)
  // the 2nd parameter is an array of 'requires'
  angular.module('starter', ['ionic'])
  
  .run(function($ionicPlatform) {
    $ionicPlatform.ready(function() {
  
  
      if(window.cordova &amp;&amp; window.cordova.plugins.Keyboard) {
        // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
        // for form inputs)
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  
        // Don't remove this line unless you know what you are doing. It stops the viewport
        // from snapping when text inputs are focused. Ionic handles this internally for
        // a much nicer keyboard experience.
        cordova.plugins.Keyboard.disableScroll(true);
      }
      if(window.StatusBar) {
        StatusBar.styleDefault();
      }
    });
  })
  
  .config(function($stateProvider, $urlRouterProvider) {
    $stateProvider
      .state('tabs', {
        url: '/tab',
        abstract: true,
        templateUrl: 'templates/tabs.html'
      })
      .state('tabs.home', {
        url: '/home',
        views: {
          'home-tab' : {
           templateUrl: 'templates/home.html'
          }
        }
      })
      .state('tabs.list', {
        url: '/list',
        views: {
          'list-tab' : {
           templateUrl: 'templates/list.html',
           controller: 'ListController'
          }
        }
      })
      .state('tabs.detail', {
        url: '/list/:aId',
        views: {
          'list-tab' : {
           templateUrl: 'templates/detail.html',
           controller: 'ListController'
          }
        }
      })
  
        // if none of the above states are matched, use this as the fallback
        $urlRouterProvider.otherwise('/tab/home');
  
  })
  
  .controller('ListController', ['$scope', '$http', '$state', function($scope, $http, $state) {
          $http.get('js/data.json').success(function(data) {
            $scope.orders = data;
            $scope.whichorder = $state.params.aId;
          });
  }]);
  </code></pre>
  
  <p><strong><em>I am perfoming this in Chrome browser on a PC</em></strong></p>