I'm working with Angular2 quick start
demo using TypeScript
. Everything is working fine with this but after completion of demo I have seen a message in my browser console
Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
I have done this with the help of this answer.
import { bootstrap } from '@angular/platform-browser-dynamic'; import { AppComponent } from './app.component'; import { enableProdMode } from '@angular/core'; enableProdMode(); bootstrap(AppComponent);
Question
Can anyone explain please?
enableProdModelinkDisable Angular's development mode, which turns off assertions and other checks within the framework.
You enable it by importing and executing the function (before calling bootstrap): import {enableProdMode} from '@angular/core'; enableProdMode(); bootstrap(....); But this error is indicator that something is wrong with your bindings, so you shouldn't just dismiss it, but try to figure out why it's happening.
Call enableProdMode() to enable the production mode.
Enabling the production mode won't disable change detection. This feature is the foundation of Angular2 to synchronize the template with the state of the associated class.
With production mode, only one run is done not two...
enableProMode
Disable Angular's development mode, which turns off assertions and other checks within the framework.
One important assertion this disables verifies that a change detection pass does not result in additional changes to any bindings (also known as unidirectional data flow).
@stable
isDevMode
Returns whether Angular is in development mode. After called once, the value is locked and won't change any more.
By default, this is true, unless a user calls enableProdMode before calling this.
@experimental APIs related to application bootstrap are currently under review.
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