Issue
Is there any sort of flag or global node variable available that tells you whether or not you are using ng serve
to run Angular?
Need this for development purposes, just need a flag of some sort.
Solution
import { isDevMode } from '@angular/core';
...
if(isDevMode()) { ...
https://angular.io/api/core/isDevMode
might work for you, but it doesn't actually tell if it is served by ng serve
Answered By - Günter Zöchbauer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.