diff options
Diffstat (limited to 'test/ng/compileSpec.js')
| -rwxr-xr-x | test/ng/compileSpec.js | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 75c111d7..356b1796 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -2480,6 +2480,30 @@ describe('$compile', function() {      }); +    it('should give the isolate scope to the controller of another replaced directives in the template', function() { +      module(function() { +        directive('testDirective', function() { +          return { +            replace: true, +            restrict: 'E', +            scope: {}, +            template: '<input type="checkbox" ng-model="model">' +          }; +        }); +      }); + +      inject(function($rootScope) { +        compile('<div><test-directive></test-directive></div>'); + +        element = element.children().eq(0); +        expect(element[0].checked).toBe(false); +        element.isolateScope().model = true; +        $rootScope.$digest(); +        expect(element[0].checked).toBe(true); +      }); +    }); + +      it('should share isolate scope with replaced directives', function() {        var normalScope;        var isolateScope; | 
