Skip to content

Commit 0d26fa9

Browse files
author
Null McNull
committed
README update use of
1 parent da99254 commit 0d26fa9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ It's also possible to do the blocking manually. The blockUI module exposes a ser
4949
});
5050
};
5151
});
52+
53+
##### Non-angular events
54+
Note that whenever you're starting or stopping a block in an event outside of _AngularJS_ you'll need to wrap this inside a `$apply` call to [make _AngularJS_ aware of changes on the scope](jimhoskins.com/2012/12/17/angularjs-and-apply.html).
55+
56+
```
57+
var button = document.getElementById('clickMe');
58+
button.addEventListener('click', buttonClicked);
59+
60+
function buttonClicked () {
61+
// Event called without the knowledge of angular
62+
$scope.$apply(function() {
63+
blockUI.stop();
64+
});
65+
}
66+
```
5267

5368
BlockUI service methods
5469
=======================

0 commit comments

Comments
 (0)