Merge pull request #2842 from vjanssens/patch-1

docs(platform): add usage info for Platform methods
This commit is contained in:
Adam Bradley
2015-01-05 07:15:37 -06:00

View File

@@ -15,6 +15,33 @@
* @ngdoc utility
* @name ionic.Platform
* @module ionic
* @description
* A set of utility methods that can be used to retrieve the device ready state and
* various other information such as what kind of platform the app is currently installed on.
*
* @usage
* ```js
* angular.module('PlatformApp', ['ionic'])
* .controller('PlatformCtrl', function($scope) {
*
* ionic.Platform.ready(function(){
* // will execute when device is ready, or immediately if the device is already ready.
* });
*
* var deviceInformation = ionic.Platform.device();
*
* var isWebView = ionic.Platform.isWebView();
* var isIPad = ionic.Platform.isIPad();
* var isIOS = ionic.Platform.isIOS();
* var isAndroid = ionic.Platform.isAndroid();
* var isWindowsPhone = ionic.Platform.isWindowsPhone();
*
* var currentPlatform = ionic.Platform.platform();
* var currentPlatformVersion = ionic.Platform.version();
*
* ionic.Platform.exit(); // stops the app
* });
* ```
*/
ionic.Platform = {