Update ionicPlatform.js

Addresses #991 - Make $ionicPlatform.ready()'s callback optional
This commit is contained in:
Robin van Baalen
2014-03-31 10:38:49 -07:00
parent 04b4d771c6
commit 13b3825034

View File

@@ -116,14 +116,14 @@ angular.module('ionic.service.platform', [])
* @description
* Trigger a callback once the device is ready,
* or immediately if the device is already ready.
* @param {function} callback The function to call.
* @param {function=} callback The function to call.
*/
ready: function(cb) {
var q = $q.defer();
ionic.Platform.ready(function(){
q.resolve();
cb();
cb && cb();
});
return q.promise;