1- import { isPresent , isBlank , RegExpWrapper , BaseException , StringWrapper } from 'angular2/src/facade/lang' ;
1+ import { isPresent , RegExpWrapper } from 'angular2/src/facade/lang' ;
22import { MapWrapper } from 'angular2/src/facade/collection' ;
33
4- import { Parser , AST , ExpressionWithSource } from 'angular2/change_detection' ;
4+ import { Parser } from 'angular2/change_detection' ;
55
66import { CompileStep } from './compile_step' ;
77import { CompileElement } from './compile_element' ;
@@ -10,16 +10,14 @@ import {CompileControl} from './compile_control';
1010import { dashCaseToCamelCase } from '../util' ;
1111import { setterFactory } from './property_setter_factory' ;
1212
13- // Group 1 = "bind"
14- // Group 2 = "var"
15- // Group 3 = "on"
16- // Group 4 = the identifier after "bind", "var", or "on"
13+ // Group 1 = "bind- "
14+ // Group 2 = "var-" or "# "
15+ // Group 3 = "on- "
16+ // Group 4 = the identifier after "bind- ", "var-/# ", or "on- "
1717// Group 5 = idenitifer inside square braces
1818// Group 6 = identifier inside parenthesis
19- // Group 7 = "#"
20- // Group 8 = identifier after "#"
2119var BIND_NAME_REGEXP = RegExpWrapper . create (
22- '^(?:(?:(?:(bind)|(var)|(on))- (.+))|\\[([^\\]]+)\\]|\\(([^\\)]+)\\)|(#)(.+ ))$' ) ;
20+ '^(?:(?:(?:(bind- )|(var-|# )|(on-)) (.+))|\\[([^\\]]+)\\]|\\(([^\\)]+)\\))$' ) ;
2321
2422/**
2523 * Parses the property bindings on a single element.
@@ -46,10 +44,9 @@ export class PropertyBindingParser extends CompileStep {
4644 if ( isPresent ( bindParts [ 1 ] ) ) {
4745 // match: bind-prop
4846 this . _bindProperty ( bindParts [ 4 ] , attrValue , current , newAttrs ) ;
49- } else if ( isPresent ( bindParts [ 2 ] ) || isPresent ( bindParts [ 7 ] ) ) {
47+ } else if ( isPresent ( bindParts [ 2 ] ) ) {
5048 // match: var-name / var-name="iden" / #name / #name="iden"
51- var identifier = ( isPresent ( bindParts [ 4 ] ) && bindParts [ 4 ] !== '' ) ?
52- bindParts [ 4 ] : bindParts [ 8 ] ;
49+ var identifier = bindParts [ 4 ] ;
5350 var value = attrValue == '' ? '\$implicit' : attrValue ;
5451 this . _bindVariable ( identifier , value , current , newAttrs ) ;
5552 } else if ( isPresent ( bindParts [ 3 ] ) ) {
0 commit comments