mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Update ionicPlatform.js
Addresses #991 - Make $ionicPlatform.ready()'s callback optional
This commit is contained in:
4
js/ext/angular/src/service/ionicPlatform.js
vendored
4
js/ext/angular/src/service/ionicPlatform.js
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user