@@ -4095,38 +4095,38 @@ describe('$compile', function() {
4095
4095
} ) ;
4096
4096
4097
4097
4098
- it ( "should not throw an error if required controller can't be found and is optional" , function ( ) {
4098
+ it ( "should pass null if required controller can't be found and is optional" , function ( ) {
4099
4099
module ( function ( ) {
4100
4100
directive ( 'dep' , function ( log ) {
4101
4101
return {
4102
4102
require : '?^main' ,
4103
4103
link : function ( scope , element , attrs , controller ) {
4104
- log ( 'dep:' + ! ! controller ) ;
4104
+ log ( 'dep:' + controller ) ;
4105
4105
}
4106
4106
} ;
4107
4107
} ) ;
4108
4108
} ) ;
4109
4109
inject ( function ( log , $compile , $rootScope ) {
4110
4110
$compile ( '<div main><div dep></div></div>' ) ( $rootScope ) ;
4111
- expect ( log ) . toEqual ( 'dep:false ' ) ;
4111
+ expect ( log ) . toEqual ( 'dep:null ' ) ;
4112
4112
} ) ;
4113
4113
} ) ;
4114
4114
4115
4115
4116
- it ( "should not throw an error if required controller can't be found and is optional with the question mark on the right" , function ( ) {
4116
+ it ( "should pass null if required controller can't be found and is optional with the question mark on the right" , function ( ) {
4117
4117
module ( function ( ) {
4118
4118
directive ( 'dep' , function ( log ) {
4119
4119
return {
4120
4120
require : '^?main' ,
4121
4121
link : function ( scope , element , attrs , controller ) {
4122
- log ( 'dep:' + ! ! controller ) ;
4122
+ log ( 'dep:' + controller ) ;
4123
4123
}
4124
4124
} ;
4125
4125
} ) ;
4126
4126
} ) ;
4127
4127
inject ( function ( log , $compile , $rootScope ) {
4128
4128
$compile ( '<div main><div dep></div></div>' ) ( $rootScope ) ;
4129
- expect ( log ) . toEqual ( 'dep:false ' ) ;
4129
+ expect ( log ) . toEqual ( 'dep:null ' ) ;
4130
4130
} ) ;
4131
4131
} ) ;
4132
4132
0 commit comments