This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1977,7 +1977,11 @@ function $ParseProvider() {
19771977 } else if ( ! interceptorFn . $stateful ) {
19781978 // Treat interceptor like filters - assume non-stateful by default and use the inputsWatchDelegate
19791979 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 ) {
19811985 // Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a
19821986 // potentially non-pure interceptor function.
19831987 if ( e . isPure === PURITY_RELATIVE ) {
Original file line number Diff line number Diff line change @@ -532,6 +532,20 @@ describe('ngClass', function() {
532532 } )
533533 ) ;
534534
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+
535549
536550 it ( 'should do value stabilization as expected when one-time binding' ,
537551 inject ( function ( $rootScope , $compile ) {
You can’t perform that action at this time.
0 commit comments