This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1977,7 +1977,11 @@ function $ParseProvider() {
1977
1977
} else if ( ! interceptorFn . $stateful ) {
1978
1978
// Treat interceptor like filters - assume non-stateful by default and use the inputsWatchDelegate
1979
1979
fn . $$watchDelegate = inputsWatchDelegate ;
1980
- fn . inputs = ( parsedExpression . inputs ? parsedExpression . inputs : [ parsedExpression ] ) . map ( function ( e ) {
1980
+ fn . inputs = parsedExpression . inputs ? parsedExpression . inputs : [ parsedExpression ] ;
1981
+ }
1982
+
1983
+ if ( fn . inputs ) {
1984
+ fn . inputs = fn . inputs . map ( function ( e ) {
1981
1985
// Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a
1982
1986
// potentially non-pure interceptor function.
1983
1987
if ( e . isPure === PURITY_RELATIVE ) {
Original file line number Diff line number Diff line change @@ -532,6 +532,20 @@ describe('ngClass', function() {
532
532
} )
533
533
) ;
534
534
535
+ it ( 'should support a one-time mixed literal-array/object variable' , inject ( function ( $rootScope , $compile ) {
536
+ element = $compile ( '<div ng-class="::[classVar1, classVar2]"></div>' ) ( $rootScope ) ;
537
+
538
+ $rootScope . classVar1 = { orange : true } ;
539
+ $rootScope . $digest ( ) ;
540
+ expect ( element ) . toHaveClass ( 'orange' ) ;
541
+
542
+ $rootScope . classVar1 . orange = false ;
543
+ $rootScope . $digest ( ) ;
544
+
545
+ expect ( element ) . not . toHaveClass ( 'orange' ) ;
546
+ } )
547
+ ) ;
548
+
535
549
536
550
it ( 'should do value stabilization as expected when one-time binding' ,
537
551
inject ( function ( $rootScope , $compile ) {
You can’t perform that action at this time.
0 commit comments