@@ -4384,7 +4384,7 @@ describe('$compile', function() {
4384
4384
} ) ) ;
4385
4385
4386
4386
4387
- it ( 'should not change the isolate when origin does not change' , inject ( function ( ) {
4387
+ it ( 'should not change the isolated scope when origin does not change' , inject ( function ( ) {
4388
4388
compile ( '<div><span my-component ref="{name: name}">' ) ;
4389
4389
4390
4390
$rootScope . name = 'a' ;
@@ -4395,6 +4395,34 @@ describe('$compile', function() {
4395
4395
} ) ) ;
4396
4396
4397
4397
4398
+ it ( 'should deep-watch array literals' , inject ( function ( ) {
4399
+ $rootScope . name = 'georgios' ;
4400
+ $rootScope . obj = { name : 'pete' } ;
4401
+ compile ( '<div><span my-component ow-ref="[{name: name}, obj]">' ) ;
4402
+ $rootScope . $apply ( ) ;
4403
+ expect ( componentScope . owRef ) . toEqual ( [ { name : 'georgios' } , { name : 'pete' } ] ) ;
4404
+
4405
+ $rootScope . name = 'lucas' ;
4406
+ $rootScope . obj = { name : 'martin' } ;
4407
+ $rootScope . $apply ( ) ;
4408
+ expect ( componentScope . owRef ) . toEqual ( [ { name : 'lucas' } , { name : 'martin' } ] ) ;
4409
+ } ) ) ;
4410
+
4411
+
4412
+ it ( 'should deep-watch object literals' , inject ( function ( ) {
4413
+ $rootScope . name = 'georgios' ;
4414
+ $rootScope . obj = { name : 'pete' } ;
4415
+ compile ( '<div><span my-component ow-ref="{name: name, item: obj}">' ) ;
4416
+ $rootScope . $apply ( ) ;
4417
+ expect ( componentScope . owRef ) . toEqual ( { name : 'georgios' , item : { name : 'pete' } } ) ;
4418
+
4419
+ $rootScope . name = 'lucas' ;
4420
+ $rootScope . obj = { name : 'martin' } ;
4421
+ $rootScope . $apply ( ) ;
4422
+ expect ( componentScope . owRef ) . toEqual ( { name : 'lucas' , item : { name : 'martin' } } ) ;
4423
+ } ) ) ;
4424
+
4425
+
4398
4426
it ( 'should not complain when the isolated scope changes' , inject ( function ( ) {
4399
4427
compile ( '<div><span my-component ow-ref="{name: name}">' ) ;
4400
4428
@@ -4430,8 +4458,8 @@ describe('$compile', function() {
4430
4458
describe ( 'optional one-way binding' , function ( ) {
4431
4459
it ( 'should update local when origin changes' , inject ( function ( ) {
4432
4460
compile ( '<div><span my-component ow-optref="name">' ) ;
4433
- expect ( componentScope . owOptRef ) . toBe ( undefined ) ;
4434
- expect ( componentScope . owOptRefAlias ) . toBe ( componentScope . owOptRef ) ;
4461
+ expect ( componentScope . owOptref ) . toBe ( undefined ) ;
4462
+ expect ( componentScope . owOptrefAlias ) . toBe ( componentScope . owOptref ) ;
4435
4463
4436
4464
$rootScope . name = 'misko' ;
4437
4465
$rootScope . $apply ( ) ;
0 commit comments