Device won't work


#1

Hi… this is the starter project run:

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleLightContent();
    }
	
	
	document.addEventListener("deviceready", onDeviceReady, false);
	function onDeviceReady() {
		alert(device.model); // WHY THIS WON'T WORK?
	}
	
  });
})

Why device won’t work?