Production mode versus development mode

Until now, we have been running Angular 2 in development mode. The difference between development and production mode is that in development mode, Angular 2 starts change detection immediately after the first run and logs a value has changed after it was checked error if anything changes between the first and second run. This helps locate bugs.

To enable production mode, place this code above the ng.platform.browser.bootstrap() method call:

ng.core.enableProdMode();

Get JavaScript: Moving to ES2015 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.