user2650480 user2650480 - 3 years ago 325
AngularJS Question

AngularJS 2 error: enableProdMode is not defined

I'm use to start learn Angular2, but I notice there's console log "Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode." So I added to main.ts as following.

import { bootstrap } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app.component';

Now the browser has error

enableProdMode is not defined(…)

So I found this article

Looks like I'm doing it right, and works on others, so maybe my package files or npm modules has something is wrong? please help, or do you know which module is using enableProdMode?

Answer Source

Seems like you missed to import enableProdMode

import {enableProdMode} from '@angular/core';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download