File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -506,7 +506,7 @@ angular.module('ui.scroll', [])
506
506
let scope = viewportScope ;
507
507
let assign ;
508
508
if ( expression ) {
509
- let match = expression . match ( / ^ ( \S + ) (?: \s + o n \s + ( \w (?: \w | \d ) * ) ) ? $ / ) ;
509
+ let match = expression . match ( / ( \w (?: \w | \d ) * ) (?: \s + o n \s + ( \w (?: \w | \d ) * ) ) ? / ) ;
510
510
if ( ! match )
511
511
throw new Error ( 'Expected injection expression in form of \'target\' or \'target on controller\' but got \'' + expression + '\'' ) ;
512
512
let target = match [ 1 ] ;
@@ -515,8 +515,8 @@ angular.module('ui.scroll', [])
515
515
let candidate = viewport ;
516
516
scope = undefined ;
517
517
while ( candidate . length ) {
518
- let controller = candidate . attr ( 'ng-controller' ) ;
519
- if ( controller === controllerName ) {
518
+ let candidateName = ( candidate . attr ( 'ng-controller' ) || '' ) . match ( / ( \w (?: \w | \d ) * ) (?: \s + a s \s + ( \w (?: \w | \d ) * ) ) ? / ) ;
519
+ if ( candidateName && candidateName [ 1 ] === controllerName ) {
520
520
scope = candidate . scope ( ) ;
521
521
break ;
522
522
}
You can’t perform that action at this time.
0 commit comments