library hello_world.index;

import "package:angular2/bootstrap.dart" show AngularEntrypoint, bootstrap;
import "package:angular2/angular2.dart"
    show Component, Directive, ElementRef, Injectable, Renderer;

@AngularEntrypoint("Hello World Entrypoint")
main() {
  bootstrap(HelloCmp);
}

@Injectable()
class GreetingService {
  String greeting = "hello";
}

@Directive(selector: "[red]")
class RedDec {
  RedDec(ElementRef el, Renderer renderer) {
    renderer.setElementStyle(el, "color", "red");
  }
}

@Component(
    selector: "hello-app",
    viewProviders: const [GreetingService],
    template:
        '''<div class="greeting">{{greeting}} <span red>world</span>!</div>
           <button class="changeButton" (click)="changeGreeting()">change greeting</button>''',
    directives: const [RedDec])
class HelloCmp {
  String greeting;
  HelloCmp(GreetingService service) {
    this.greeting = service.greeting;
  }
  void changeGreeting() {
    this.greeting = "howdy";
  }
}

library hello_world.index;

import "package:angular2/bootstrap.dart" show AngularEntrypoint, bootstrap;
import "package:angular2/angular2.dart"
    show Component, Directive, ElementRef, Injectable, Renderer;

@AngularEntrypoint("Hello World Entrypoint")
main() {
  bootstrap(HelloCmp);
}

@Injectable()
class GreetingService {
  String greeting = "hello";
}

@Directive(selector: "[red]")
class RedDec {
  RedDec(ElementRef el, Renderer renderer) {
    renderer.setElementStyle(el.nativeElement, "color", "red");
  }
}

@Component(
    selector: "hello-app",
    viewProviders: const [GreetingService],
    template:
        '''<div class="greeting">{{greeting}} <span red>world</span>!</div>
           <button class="changeButton" (click)="changeGreeting()">change greeting</button>''',
    directives: const [RedDec])
class HelloCmp {
  String greeting;
  HelloCmp(GreetingService service) {
    this.greeting = service.greeting;
  }
  void changeGreeting() {
    this.greeting = "howdy";
  }
}

Fix runtime error in hello_world payload app
fix(dart/payload): Fix runtime error in hello_world payload app

The hello_world app used to measure Dart payload size was broken by a
change in
https://github.com/angular/angular/commit/7ae23adaff2990cf6022af9792c449730d451d1d.

This breakage does not materially affect the size of the generated code,
(before fix: 298819, after fix: 298825), and since it was a runtime
error it was not noticed & not a problem.

Update the app to work again.

Closes #7358
