@@ -22,13 +22,15 @@ export class AttrAst implements TemplateAst {
2222 visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitAttr ( this ) ; }
2323}
2424
25- export class BoundPropertyAst implements TemplateAst {
26- constructor ( public name : string , public value : AST , public sourceInfo : string ) { }
27- visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitProperty ( this ) ; }
25+ export class BoundElementPropertyAst implements TemplateAst {
26+ constructor ( public name : string , public type : PropertyBindingType , public value : AST ,
27+ public unit : string , public sourceInfo : string ) { }
28+ visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitElementProperty ( this ) ; }
2829}
2930
3031export class BoundEventAst implements TemplateAst {
31- constructor ( public name : string , public handler : AST , public sourceInfo : string ) { }
32+ constructor ( public name : string , public target : string , public handler : AST ,
33+ public sourceInfo : string ) { }
3234 visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitEvent ( this ) ; }
3335}
3436
@@ -38,35 +40,57 @@ export class VariableAst implements TemplateAst {
3840}
3941
4042export class ElementAst implements TemplateAst {
41- constructor ( public attrs : AttrAst [ ] , public properties : BoundPropertyAst [ ] ,
43+ constructor ( public attrs : AttrAst [ ] , public properties : BoundElementPropertyAst [ ] ,
4244 public events : BoundEventAst [ ] , public vars : VariableAst [ ] ,
43- public directives : DirectiveMetadata [ ] , public children : TemplateAst [ ] ,
45+ public directives : DirectiveAst [ ] , public children : TemplateAst [ ] ,
4446 public sourceInfo : string ) { }
4547 visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitElement ( this ) ; }
4648}
4749
4850export class EmbeddedTemplateAst implements TemplateAst {
49- constructor ( public attrs : AttrAst [ ] , public properties : BoundPropertyAst [ ] ,
50- public vars : VariableAst [ ] , public directives : DirectiveMetadata [ ] ,
51- public children : TemplateAst [ ] , public sourceInfo : string ) { }
51+ constructor ( public attrs : AttrAst [ ] , public vars : VariableAst [ ] ,
52+ public directives : DirectiveAst [ ] , public children : TemplateAst [ ] ,
53+ public sourceInfo : string ) { }
5254 visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitEmbeddedTemplate ( this ) ; }
5355}
5456
57+ export class BoundDirectivePropertyAst implements TemplateAst {
58+ constructor ( public directiveName : string , public templateName : string , public value : AST ,
59+ public sourceInfo : string ) { }
60+ visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitDirectiveProperty ( this ) ; }
61+ }
62+
63+ export class DirectiveAst implements TemplateAst {
64+ constructor ( public directive : DirectiveMetadata , public properties : BoundDirectivePropertyAst [ ] ,
65+ public hostProperties : BoundElementPropertyAst [ ] , public hostEvents : BoundEventAst [ ] ,
66+ public sourceInfo : string ) { }
67+ visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitDirective ( this ) ; }
68+ }
69+
5570export class NgContentAst implements TemplateAst {
5671 constructor ( public select : string , public sourceInfo : string ) { }
5772 visit ( visitor : TemplateAstVisitor ) : any { return visitor . visitNgContent ( this ) ; }
5873}
5974
75+ export enum PropertyBindingType {
76+ Property ,
77+ Attribute ,
78+ Class ,
79+ Style
80+ }
81+
6082export interface TemplateAstVisitor {
6183 visitNgContent ( ast : NgContentAst ) : any ;
6284 visitEmbeddedTemplate ( ast : EmbeddedTemplateAst ) : any ;
6385 visitElement ( ast : ElementAst ) : any ;
6486 visitVariable ( ast : VariableAst ) : any ;
6587 visitEvent ( ast : BoundEventAst ) : any ;
66- visitProperty ( ast : BoundPropertyAst ) : any ;
88+ visitElementProperty ( ast : BoundElementPropertyAst ) : any ;
6789 visitAttr ( ast : AttrAst ) : any ;
6890 visitBoundText ( ast : BoundTextAst ) : any ;
6991 visitText ( ast : TextAst ) : any ;
92+ visitDirective ( ast : DirectiveAst ) : any ;
93+ visitDirectiveProperty ( ast : BoundDirectivePropertyAst ) : any ;
7094}
7195
7296
0 commit comments