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

Commit

Permalink
Inject rootScope and change timeouts to evalAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBosZ committed Apr 30, 2015
1 parent e47a98e commit 0dc3b65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

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

.factory('$cordovaKeyboard', [function () {
.factory('$cordovaKeyboard', ['$rootScope', function ($rootScope) {

var keyboardShowEvent = function () {
$timeout(function () {
$rootScope.$evalAsync(function () {
$rootScope.$broadcast('$cordovaKeyboard:show');
});
};

var keyboardHideEvent = function () {
$timeout(function () {
$rootScope.$evalAsync(function () {
$rootScope.$broadcast('$cordovaKeyboard:hide');
});
};
Expand Down

3 comments on commit 0dc3b65

@vladipus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to have this in release aswell.
Using bower install ngCordova#master at the moment.

@skymovinggit
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢@vladipus ,问题已解决

@vladipus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skymovinggit you're welcome)

Please sign in to comment.