diff --git a/test/directive/ng_repeat_spec.dart b/test/directive/ng_repeat_spec.dart index a3e6f8d34..cddc9d93e 100644 --- a/test/directive/ng_repeat_spec.dart +++ b/test/directive/ng_repeat_spec.dart @@ -9,10 +9,15 @@ main() { beforeEach(inject((Injector injector, Scope $rootScope, Compiler compiler, DirectiveMap _directives) { $exceptionHandler = injector.get(ExceptionHandler); scope = $rootScope; - $compile = (html) { + $compile = (html, [scope]) { element = $(html); var viewFactory = compiler(element, _directives); - var view = viewFactory(injector, element); + var blockInjector = injector; + if (scope != null) { + viewFactory.bind(injector)(scope); + } else { + viewFactory(injector, element); + } return element; }; directives = _directives; @@ -404,5 +409,19 @@ main() { }); }); + + it('should correctly handle detached state', () { + scope.context['items'] = [1]; + + var parentScope = scope.createChild(new PrototypeMap(scope.context)); + element = $compile( + '