Skip to content

Instantly share code, notes, and snippets.

@jacoor
Created November 24, 2014 14:37
Show Gist options
  • Save jacoor/8259bd8017b64d3be497 to your computer and use it in GitHub Desktop.
Save jacoor/8259bd8017b64d3be497 to your computer and use it in GitHub Desktop.
ios status bar ngcordova directive
/* jslint browser: true, undef: true, newcap: true, forin: true, sub: true, white: true, indent: 4, unused: false */
/* globals define: true, Settings: true, console: true */
define([
'app/app',
'ngCordova',
], function(
App
) {
"use strict";
var directive = App.directive('aaIosStatusbar', [function($cordovaStatusbar) {
return {
controller: function($scope, $cordovaStatusbar) {
$scope.$root.$on('aaIosStatusbar.show', function(event) {
if (Settings.isMobileApp){
$cordovaStatusbar.show();
}
});
$scope.$root.$on('aaIosStatusbar.hide', function(event) {
if (Settings.isMobileApp){
$cordovaStatusbar.hide();
}
});
}
};
}]);
return directive;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment