Summary
I hope you like the new shiny tools that we added to your toolbox in this chapter. We started with an overview of Angular Ivy's runtime debugging API, which is available only in development mode.
Next, we learned how to inspect a component instance using ng.getComponent
and ng.getOwningComponent
. We also changed the component state, then updated the DOM using ng.applyChanges
.
In the Inspecting event listeners section, we used ng.getListeners
to inspect both native DOM event listeners and custom component event listeners. We passed arguments to their callbacks and triggered change detection using ng.applyChanges
.
Finally, you now know what an embedded view context is and how to inspect it, for example, how one is created and bound to each component or element managed by the NgFor
directive. Similarly, we explored an example of an embedded view context for an element managed by an NgIf
directive.
With all these newfound skills, you are ready to debug Angular...