anchor.diff:  @Tags(const ['codegen'])
   @TestOn('browser && !js')
  -library angular2.test.core.linker.host_events_test;
  -
  +import 'dart:async';
   import 'dart:html';
   
   import 'package:angular2/angular2.dart';
  
positive.code: import 'package:test/test.dart';
  
  void main() {
    group('Events', () {
      tearDown(() => disposeAnyRunningTest());
      test('defined inside component itself should add listeners', () async {
        var testBed = new NgTestBed<ComponentWithEventTest>();
        var testFixture = await testBed.create();
        Element element =
            testFixture.rootElement.querySelector('component-with-event > input');
        expect(element, isNotNull);
        expect(element.attributes["has-focus"], 'false');
        element.focus();
        await testFixture.update();
        expect(element.attributes["has-focus"], 'true');
      });
      test('defined on host should add listeners', () async {
        var testBed = new NgTestBed<ComponentWithHostEvent>();
        var testFixture = await testBed.create();
        Element divElement = testFixture.rootElement
            .querySelector('component-with-hostevent > div');
        expect(divElement, isNotNull);
        Element hostElement = divElement.parent;
        hostElement.tabIndex = 1;
        hostElement.focus();
        await testFixture.update();
        expect(divElement.attributes['has-focus'], 'true');
      });
    });
  }
  
  @Component(
      selector: 'component-with-event-test',
      template: '<component-with-event></component-with-event>',
      directives: const [ComponentWithEvent])
  class ComponentWithEventTest {}
  
  @Component(
      selector: 'component-with-event',
      template: '<input id="my_element" (focus)="onFocus()" (blur)="onBlur()" '
          '[attr.has-focus]="hasFocus">')
  class ComponentWithEvent {
    bool hasFocus = false;
    void onFocus() {
      hasFocus = true;
    }
  
negative.code:   }
  }
  
  /// Tests that `@Component(host: ...)` works.
  @Component(
    selector: 'component-with-hostevent',
    host: const {
      '(focus)': 'onFocus()',
      '(blur)': 'onBlur()',
    },
    template: '<div [attr.has-focus]="hasFocus"></div>',
  )
  class ComponentWithHostEvent {
    bool hasFocus = false;
  
    void onFocus() {
      hasFocus = true;
  