title: “device is not defined” : Ionic/Cordova app - trying to collect device model/manufacturer
body: <p>I have installed the cordova plugin 'cordova-plugin-device' and am trying to retrieve the device object to get the model and manufacturer for the device running my app.
  <a href="https://www.npmjs.com/package/cordova-plugin-device" rel="nofollow">https://www.npmjs.com/package/cordova-plugin-device</a></p>
  
  <p>Currently my app is split into sections, my 'about' section controller looks like follows:</p>
  
  <p>// coffeescript code</p>
  
  <pre><code>angular.module('aboutPageController', ['ionic', 'ngCordova'])
  .controller 'aboutPage',['$scope', '$ionicPlatform', '$cordovaDevice', ($scope, $ionicPlatform, $cordovaDevice) -&gt;
  $scope.aboutTxt = 'some text'
  $ionicPlatform.ready -&gt;
    $scope.$apply -&gt;    
    $scope.aboutTxt = 'new text'
    device = $cordovaDevice.getDevice()
    console.log(device)
    deviceInformation = $ionicPlatform.device()
    $scope.aboutTxt = deviceInformation.model
    return
   return
  return
  ]
  </code></pre>
  
  <p>
  
  
      
      
      My App
      
      
      </p>
  
  <pre><code>&lt;!-- ionic/angularjs js --&gt;
  &lt;script src="js/ionic.bundle.js"&gt;&lt;/script&gt;
  &lt;script src="js/angular-resource.js"&gt;&lt;/script&gt;
  &lt;script src="js/ng-cordova.min.js"&gt;&lt;/script&gt;
  &lt;script src="cordova.js"&gt;&lt;/script&gt;
  
  &lt;!-- your app's js --&gt;
  &lt;script src="js/app.js"&gt;&lt;/script&gt;
  &lt;script src="js/templates.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>
  
  
  </p>
  
  <p>I am currently getting the following error device</p>
  
  <pre><code>ReferenceError: device is not defined
  </code></pre>
  
  <p>in ionic.bundle.js:25642 ReferenceError: device is not defined</p>