fix(compiler): fix a typo in BIND_NAME_REGEXP

This commit is contained in:
Victor Berchet 2014-12-18 11:39:37 +01:00
parent 45008884e4
commit 7027674081
2 changed files with 5 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import {CompileControl} from './compile_control';
import {interpolationToExpression} from './text_interpolation_parser';
// TODO(tbosch): Cannot make this const/final right now because of the transpiler...
var BIND_NAME_REGEXP = RegExpWrapper.create('^(?:(?:(bind)|(let)|(on))-(.+))|\\[([^\\]]+)\\]|\\(([^\\]]+)\\)');
var BIND_NAME_REGEXP = RegExpWrapper.create('^(?:(?:(bind)|(let)|(on))-(.+))|\\[([^\\]]+)\\]|\\(([^\\)]+)\\)');
/**
* Parses the property bindings on a single element.

View File

@ -43,6 +43,10 @@ export function main() {
it('should detect () syntax', () => {
var results = createPipeline().process(createElement('<div (click)="b()"></div>'));
expect(MapWrapper.get(results[0].eventBindings, 'click').source).toEqual('b()');
// "(click[])" is not an expected syntax and is only used to validate the regexp
results = createPipeline().process(createElement('<div (click[])="b()"></div>'));
expect(MapWrapper.get(results[0].eventBindings, 'click[]').source).toEqual('b()');
});
it('should detect on- syntax', () => {