anchor.diff:    bool ctxBoolProp;
     @ViewChild('loc', read: ViewContainerRef)
     ViewContainerRef viewContainerRef;
  -  MyComp() {
  +  final DynamicComponentLoader loader;
  +  MyComp(this.loader) {
       this.ctxBoolProp = false;
     }
   }
  
positive.code:   };
  }
  
  @Component(selector: 'child-cmp', template: '{{ctxProp}}')
  class ChildComp {
    ElementRef elementRef;
    String ctxProp;
  
negative.code: @Tags(const ['codegen'])
  @TestOn('browser')
  
  import 'dart:html';
  
  import 'package:angular2/angular2.dart';
  import 'package:angular2/src/debug/debug_node.dart';
  import 'package:angular2/src/facade/exceptions.dart' show BaseException;
  import "package:angular2/src/testing/internal.dart";
  import 'package:angular_test/angular_test.dart';
  import 'package:test/test.dart';
  
  void main() {
    group('DynamicComponentLoader', () {
      tearDown(() => disposeAnyRunningTest());
  
      test('loading next to a location', () async {
        var testBed = new NgTestBed<MyComp>();
        var fixture = await testBed.create();
        fixture.update((MyComp component) {
          component.loader
              .loadNextToLocation(DynamicallyLoaded, component.viewContainerRef)
              .then((ref) {
            expect(fixture.text, 'DynamicallyLoaded;');
          });
        });
      });
      test('should return a disposable component ref', () async {
        var testBed = new NgTestBed<MyComp>();
        var fixture = await testBed.create();
        fixture.update((MyComp component) {
          component.loader
              .loadNextToLocation(DynamicallyLoaded, component.viewContainerRef)
              .then((ref) {
            component.loader
                .loadNextToLocation(
                    DynamicallyLoaded2, component.viewContainerRef)
                .then((ref2) {
              expect(fixture.text, 'DynamicallyLoaded;DynamicallyLoaded2;');
              ref2.destroy();
              expect(fixture.text, 'DynamicallyLoaded;');
            });
          });
        });
      });
  
      test('should update host properties', () async {
        var testBed = new NgTestBed<MyComp>();
        var fixture = await testBed.create();
        ComponentRef loadedComponent;
        await fixture.update((MyComp component) async {
          loadedComponent = await component.loader.loadNextToLocation(
              DynamicallyLoadedWithHostProps, component.viewContainerRef);
        });
        await fixture.update((MyComp component) {
          loadedComponent.instance.id = 'new value';
        });
  
        var newlyInsertedElement =
            (getDebugNode(fixture.rootElement) as DebugElement)
                .children[1]
                .nativeNode;
        expect(((newlyInsertedElement as dynamic)).id, 'new value');
      });
  
      test('should leave the view tree in a consistent state if hydration fails',
          () async {
        var testBed = new NgTestBed<MyComp>();
        var fixture = await testBed.create();
        String errorMsg;
        await fixture.update((MyComp component) async {
          component.loader
              .loadNextToLocation(
                  DynamicallyLoadedThrows, component.viewContainerRef)
              .then((loadedComponent) {})
              .catchError((error) async {
            errorMsg = error.message;
          });
        });
  
        expect(errorMsg, contains('ThrownInConstructor'));
        // should not throw.
        await fixture.update((MyComp component) {});
      });
  
      test('should allow to pass projectable nodes', () async {
        var testBed = new NgTestBed<MyComp>();
        var fixture = await testBed.create();
        ComponentRef loadedComponent;
        await fixture.update((MyComp component) async {
          loadedComponent = await component.loader.loadNextToLocation(
              DynamicallyLoadedWithNgContent, component.viewContainerRef, null, [
            [new Text('hello')]
          ]);
          var newlyInsertedElement =
              (getDebugNode(fixture.rootElement) as DebugElement)
                  .children[1]
                  .nativeNode;
          expect(newlyInsertedElement, hasTextContent('dynamic(hello)'));
        });
      });
    });
  
    group('loadAsRoot', () {
      tearDown(() => disposeAnyRunningTest());
  
      test('should allow to create, update and destroy components', () async {
        var testBed = new NgTestBed<MyComp>();
        var fixture = await testBed.create();
        var rootEl;
        ComponentRef componentRef;
        await fixture.update((MyComp component) async {
          componentRef = await component.loader.load(ChildComp, null);
          rootEl = componentRef.location.nativeElement as Element;
          document.body.append(rootEl);
        });
        componentRef.changeDetectorRef.detectChanges();
        expect(rootEl, hasTextContent('CHILD_hello'));
        componentRef.instance.ctxProp = 'new';
        componentRef.changeDetectorRef.detectChanges();
        expect(rootEl, hasTextContent('CHILD_new'));
        componentRef.destroy();
        expect(rootEl.parentNode, isNull);
      });
  
      test('should allow to pass projectable nodes', () async {
        var testBed = new NgTestBed<MyComp>();
        var fixture = await testBed.create();
        var rootEl;
        ComponentRef componentRef;
        await fixture.update((MyComp component) async {
          componentRef = await component.loader
              .load(DynamicallyLoadedWithNgContent, null, projectableNodes: [
            [new Text('hello')]
          ]);
          rootEl = componentRef.location.nativeElement as Element;
        });
        document.body.append(rootEl);
        componentRef.changeDetectorRef.detectChanges();
        expect(rootEl, hasTextContent('dynamic(hello)'));
      });
    });
  }
  