For some reason, I have to run my app in production mode. What is the difference between those modes?
Production mode minifies your code and better represents the performance your app will have on end users' devices. Development mode includes useful warnings and gives you access to tools that make development and debugging easier.
The development environment is your local computer, while the production environment is the live product customers or visitors might interact with.
In the Production mode, you cannot copy your files or database to the Production environment. This protects you from possibly destroying your live application by overwriting your Production files and databases. You copy databases and files up to the Production environment only until you first launch your application.
Call enableProdMode() to enable the production mode.
In development mode, change detection does a second run immediately after the first run and produces an error if any bound value has changed between the first and the second run. This helps to locate bugs where checking values has side-effects or fields or functions don't return the same value on subsequent calls which undermines Angular's change detection.
In development mode, during the second change detection run, Angular also does some deep object comparisons that it won't do in production to detect model changes that are disallowed.
Update:
In development mode, a hint is also printed to the console when the HTML sanitizer service strips values from bindings [innerHTML]="..."
or [ngStyle]="..."
. See also: In RC.1 some styles can't be added using binding syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With