# deviceReady how to

**URL:** <https://forum.ionicframework.com/t/deviceready-how-to/1336>\
**Category:** ionic-v1\
**Created:** [February 24, 2014, 6:03pm UTC](https://forum.ionicframework.com/t/deviceready-how-to/1336 "2014-02-24T18:03:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pink\_tshirt](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@pink\_tshirt](https://forum.ionicframework.com/u/pink_tshirt)\
**Post date:** [March 3, 2014, 8:33pm UTC](https://forum.ionicframework.com/t/deviceready-how-to/1336/4 "2014-03-03T20:33:01Z")

</div>

Thank you jough but I still cant get it work:(

For example I have a controller:

```
.controller('infoCtrl', function($scope) {
  ionic.Platform.ready(function() {
    var device = ionic.Platform.device();
    alert(device.platform);
  });
});

```

and it returns **undefined** when I run it on iPhone.

p.s. I have installed **org.apache.cordova.device** and my config.xml is

```
<feature name="Device">
    <param name="ios-package" value="CDVDevice" />
</feature>
```

---

_[View the full topic](https://forum.ionicframework.com/t/deviceready-how-to/1336)._
