Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS 2 error: enableProdMode is not defined

I'm use https://angular.io/guide/quickstart 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';
enableProdMode();
bootstrap(AppComponent);

Now the browser has error

enableProdMode is not defined(…)

So I found this article https://github.com/angular/angular/issues/6096.

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?

like image 399
user2650480 Avatar asked Jun 16 '16 16:06

user2650480


1 Answers

Seems like you missed to import enableProdMode

import {enableProdMode} from '@angular/core';
like image 60
Pankaj Parkar Avatar answered Oct 05 '22 00:10

Pankaj Parkar