Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit a27ea9d

Browse files
SomeKittensbtford
authored andcommitted
feat(events) Give angular.hint ability to emit events
angular.hint is now an EventEmitter and can emit capturable, namespaced events Closes #75
1 parent 50fd74a commit a27ea9d

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

hint.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
'use strict';
22

3+
// Set up the event stuffs
4+
require('./src/modules/hintEmitter');
5+
36
// Create pipe for all hint messages from different modules
47
require('./src/modules/log');
58

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"angular-hint-dom": "~0.5.0",
3030
"angular-hint-interpolation": "~0.3.0",
3131
"debounce-on": "0.0.0",
32+
"eventemitter2": "^0.4.14",
3233
"suggest-it": "0.0.1"
3334
},
3435
"devDependencies": {

src/modules/hintEmitter.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
/**
4+
* We use EventEmitter2 here in order to have scoped events
5+
* For instance:
6+
* hint.emit('scope:digest', {
7+
*/
8+
var EventEmitter2 = require('eventemitter2').EventEmitter2;
9+
10+
angular.hint = new EventEmitter2({
11+
wildcard: true,
12+
delimiter: ':'
13+
});

0 commit comments

Comments
 (0)