Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Commit 0dc3b65

Browse files
committed
Inject rootScope and change timeouts to evalAsync
1 parent e47a98e commit 0dc3b65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plugins/keyboard.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
angular.module('ngCordova.plugins.keyboard', [])
55

6-
.factory('$cordovaKeyboard', [function () {
6+
.factory('$cordovaKeyboard', ['$rootScope', function ($rootScope) {
77

88
var keyboardShowEvent = function () {
9-
$timeout(function () {
9+
$rootScope.$evalAsync(function () {
1010
$rootScope.$broadcast('$cordovaKeyboard:show');
1111
});
1212
};
1313

1414
var keyboardHideEvent = function () {
15-
$timeout(function () {
15+
$rootScope.$evalAsync(function () {
1616
$rootScope.$broadcast('$cordovaKeyboard:hide');
1717
});
1818
};

0 commit comments

Comments
 (0)