feat(events): adds support for injectable angular event emitters.
Event emitters can be injected into Directives. Event emitters take over
browser events with the same name. Emitted events do not bubble. Event
emitters can be injected even if there is no corresponding callback in
the template.
Use as follows:
@Decorator(...)
class MyDec(@EventEmitter('click') clickEmitter) {
...
fireClick() {
var eventData = {...};
this._clickEmitter(eventData);
}
}
This commit is contained in:
@@ -31,11 +31,11 @@ export function main() {
|
||||
|
||||
var bindings = [A, B, C];
|
||||
var proto = new ProtoElementInjector(null, 0, bindings);
|
||||
var elementInjector = proto.instantiate(null,null);
|
||||
var elementInjector = proto.instantiate(null,null, null);
|
||||
|
||||
function instantiate () {
|
||||
for (var i = 0; i < iterations; ++i) {
|
||||
var ei = proto.instantiate(null, null);
|
||||
var ei = proto.instantiate(null, null, null);
|
||||
ei.instantiateDirectives(appInjector, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user