From 7485cf2b006619298c37491b21a5c6941c1b30df Mon Sep 17 00:00:00 2001 From: vjanssens Date: Fri, 2 Jan 2015 21:27:08 +0100 Subject: [PATCH] Added usage information for Platform methods --- js/utils/platform.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/js/utils/platform.js b/js/utils/platform.js index dda2e5a20e..ebb047bf61 100644 --- a/js/utils/platform.js +++ b/js/utils/platform.js @@ -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 = {