Skip to content

Commit c175656

Browse files
committed
a fix for broken tests
1 parent 5cea616 commit c175656

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ui-scroll.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,9 @@ angular.module('ui.scroll', [])
506506
let scope = viewportScope;
507507
let assign;
508508
if (expression) {
509-
let match = expression.match(/(\w(?:\w|\d)*)(?:\s+on\s+(\w(?:\w|\d)*))?/);
509+
// it is ok to have relaxed validation for the first part of the 'on' expression.
510+
// additional validation will be done by the $parse service below
511+
let match = expression.match(/^(\S+)(?:\s+on\s+(\w(?:\w|\d)*))?/);
510512
if (!match)
511513
throw new Error('Expected injection expression in form of \'target\' or \'target on controller\' but got \'' + expression + '\'');
512514
let target = match[1];

0 commit comments

Comments
 (0)