angular-samples icon indicating copy to clipboard operation
angular-samples copied to clipboard

Can you explain unit test for event emitter?

Open junjunruan opened this issue 10 years ago • 0 comments

In angular-2-samples/unit-test-scenarios/event-emitter/event-emitter-spec.ts folder, can you explain the code there?

My understand about your code would be: you called the function sayHello() in the code manually.

  1. why don't you use mouse event function like click(). Of course, I don't know if there is such click function exist.
  2. why put child.sayHello(); after child.greeting.subscribe()?
  3. Can you explain how the done function work here? Is there any other way to handle asyn problem. I have heard that angular2 make it more easier to deal with the problem.
  4. When I looked at your blog: http://www.syntaxsuccess.com/viewarticle/angular-2.0-unit-testing. I still have some questions. Can you recommend me some reference to learn Angular2 an Angular2 unit testing?

junjunruan avatar Feb 25 '16 15:02 junjunruan