O'Reilly logo

Angular 2 Cookbook by Matt Frisbie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding and properly utilizing enableProdMode with pure and impure pipes

Angular 2's change detection process is an elegant but fickle beast that is challenging to understand at first. While it offers huge efficiency gains over the 1.x framework, the gains can come at a cost. The development mode of Angular is activated by default, which will alert you when your code is in danger of behaving in a way that defeats the change detection efficiency gains. In this recipe, you'll implement a feature that violates Angular's change detection schema, correct it, and safely use enableProdMode.

Note

The code, links, and a live example related to this recipe are available at http://ngcookbook.herokuapp.com/0623/.

Getting ready

Begin with a simple component: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required