feat(events): add support for global events

Fixes #1098
Closes #1255
This commit is contained in:
Marc Laval
2015-04-02 15:56:58 +02:00
parent 7c95cea3a8
commit b96e560c8d
27 changed files with 414 additions and 103 deletions
+12 -2
View File
@@ -15,6 +15,16 @@ import {ASTWithSource} from 'angular2/change_detection';
* - render compiler is not on the critical path as
* its output will be stored in precompiled templates.
*/
export class EventBinding {
fullName: string; // name/target:name, e.g "click", "window:resize"
source: ASTWithSource;
constructor(fullName :string, source: ASTWithSource) {
this.fullName = fullName;
this.source = source;
}
}
export class ElementBinder {
index:number;
parentIndex:number;
@@ -26,7 +36,7 @@ export class ElementBinder {
// Note: this contains a preprocessed AST
// that replaced the values that should be extracted from the element
// with a local name
eventBindings: Map<string, ASTWithSource>;
eventBindings: List<EventBinding>;
textBindings: List<ASTWithSource>;
readAttributes: Map<string, string>;
@@ -57,7 +67,7 @@ export class DirectiveBinder {
// Note: this contains a preprocessed AST
// that replaced the values that should be extracted from the element
// with a local name
eventBindings: Map<string, ASTWithSource>;
eventBindings: List<EventBinding>;
constructor({
directiveIndex, propertyBindings, eventBindings
}) {