fix(compiler): fix a typo in BIND_NAME_REGEXP
This commit is contained in:
parent
45008884e4
commit
7027674081
|
@ -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.
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue