@@ -12,13 +12,14 @@ import {dashCaseToCamelCase} from '../util';
1212// Group 1 = "bind-"
1313// Group 2 = "var-" or "#"
1414// Group 3 = "on-"
15- // Group 4 = "bindon-"
16- // Group 5 = the identifier after "bind-", "var-/#", or "on-"
17- // Group 6 = idenitifer inside [()]
18- // Group 7 = idenitifer inside []
19- // Group 8 = identifier inside ()
15+ // Group 4 = "onbubble-"
16+ // Group 5 = "bindon-"
17+ // Group 6 = the identifier after "bind-", "var-/#", or "on-"
18+ // Group 7 = idenitifer inside [()]
19+ // Group 8 = idenitifer inside []
20+ // Group 9 = identifier inside ()
2021var BIND_NAME_REGEXP =
21- / ^ (?: (?: (?: ( b i n d - ) | ( v a r - | # ) | ( o n - ) | ( b i n d o n - ) ) ( .+ ) ) | \[ \( ( [ ^ \) ] + ) \) \] | \[ ( [ ^ \] ] + ) \] | \( ( [ ^ \) ] + ) \) ) $ / g;
22+ / ^ (?: (?: (?: ( b i n d - ) | ( v a r - | # ) | ( o n - ) | ( o n b u b b l e - ) | ( b i n d o n - ) ) ( .+ ) ) | \[ \( ( [ ^ \) ] + ) \) \] | \[ ( [ ^ \] ] + ) \] | \( ( [ ^ \) ] + ) \) ) $ / g;
2223/**
2324 * Parses the property bindings on a single element.
2425 */
@@ -38,30 +39,33 @@ export class PropertyBindingParser implements CompileStep {
3839 var bindParts = RegExpWrapper . firstMatch ( BIND_NAME_REGEXP , attrName ) ;
3940 if ( isPresent ( bindParts ) ) {
4041 if ( isPresent ( bindParts [ 1 ] ) ) { // match: bind-prop
41- this . _bindProperty ( bindParts [ 5 ] , attrValue , current , newAttrs ) ;
42+ this . _bindProperty ( bindParts [ 6 ] , attrValue , current , newAttrs ) ;
4243
4344 } else if ( isPresent (
4445 bindParts [ 2 ] ) ) { // match: var-name / var-name="iden" / #name / #name="iden"
45- var identifier = bindParts [ 5 ] ;
46+ var identifier = bindParts [ 6 ] ;
4647 var value = attrValue == '' ? '\$implicit' : attrValue ;
4748 this . _bindVariable ( identifier , value , current , newAttrs ) ;
4849
4950 } else if ( isPresent ( bindParts [ 3 ] ) ) { // match: on-event
50- this . _bindEvent ( bindParts [ 5 ] , attrValue , current , newAttrs ) ;
51+ this . _bindEvent ( bindParts [ 6 ] , attrValue , current , newAttrs ) ;
5152
52- } else if ( isPresent ( bindParts [ 4 ] ) ) { // match: bindon-prop
53- this . _bindProperty ( bindParts [ 5 ] , attrValue , current , newAttrs ) ;
54- this . _bindAssignmentEvent ( bindParts [ 5 ] , attrValue , current , newAttrs ) ;
53+ } else if ( isPresent ( bindParts [ 4 ] ) ) { // match: onbubble-event
54+ this . _bindEvent ( '^' + bindParts [ 6 ] , attrValue , current , newAttrs ) ;
5555
56- } else if ( isPresent ( bindParts [ 6 ] ) ) { // match: [(expr)]
56+ } else if ( isPresent ( bindParts [ 5 ] ) ) { // match: bindon-prop
5757 this . _bindProperty ( bindParts [ 6 ] , attrValue , current , newAttrs ) ;
5858 this . _bindAssignmentEvent ( bindParts [ 6 ] , attrValue , current , newAttrs ) ;
5959
60- } else if ( isPresent ( bindParts [ 7 ] ) ) { // match: [expr]
60+ } else if ( isPresent ( bindParts [ 7 ] ) ) { // match: [( expr) ]
6161 this . _bindProperty ( bindParts [ 7 ] , attrValue , current , newAttrs ) ;
62+ this . _bindAssignmentEvent ( bindParts [ 7 ] , attrValue , current , newAttrs ) ;
63+
64+ } else if ( isPresent ( bindParts [ 8 ] ) ) { // match: [expr]
65+ this . _bindProperty ( bindParts [ 8 ] , attrValue , current , newAttrs ) ;
6266
63- } else if ( isPresent ( bindParts [ 8 ] ) ) { // match: (event)
64- this . _bindEvent ( bindParts [ 8 ] , attrValue , current , newAttrs ) ;
67+ } else if ( isPresent ( bindParts [ 9 ] ) ) { // match: (event)
68+ this . _bindEvent ( bindParts [ 9 ] , attrValue , current , newAttrs ) ;
6569 }
6670 } else {
6771 var expr = this . _parser . parseInterpolation ( attrValue , current . elementDescription ) ;
0 commit comments