Hi,
I wanted to use the environment.ts and environment.prod.ts files to set 
some variables.
I added a console.log to the service code to see if they were being set.
When I run ng serve, the code compiles and the browser console shows my 
comment and the value is as expected; so far so good.

But when I run ng serve -prod to see if the comment changes with the new 
value, I get the following warning (?) and error
****************************************************************************************
This is a simple server for use in testing or debugging Angular 
applications locally.
It hasn't been reviewed for security issues.
DON'T USE IT FOR PRODUCTION USE!
****************************************************************************************
** NG Live Development Server is running on http://localhost:4200. **

(This is a comment/warning?) followed by

ERROR in 
C:/Temp/angularjs_example/angular2/heroes_new/src/environments/environment.ts 
(2,19): ',' expected.)
C:/Temp/angularjs_example/angular2/heroes_new/src/environments/environment.ts 
(6,36): ',' expected.)
webpack: Failed to compile.

Now the thing I do not understand is that environment.ts (2,19): is a 
comment
// The build system defaults to the dev environment which uses 
`environment.ts`, but if you do

and actually adding a comma to the above comment then allows compile to 
succeed.

Can someone explain this?

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to