You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
I think it could be useful to have some mechanism to inject variables within angularjs logic according to our env. I know that we can pass in some properties from env configs using express and swig and those are indeed dependent in the current env. But today I was reading this part of the Angular docs and I wanted to set both $compileProvider.debugInfoEnabled(false); and ng-strict-di="true" only while in production.
Im not sure if it is possible/correct/safe to set those angular vars the same way we do for the ones with express/swig, so in my app I ended up creating a module like this:
The @@debugInfoEnabled expression will be replaced using grunt-replace task by matching the pattern @@ and then inject this module in the main mean module.
The downside is that I need to have an extra dummy file with the matching expressions like showed above that will generate the file with the replaced expressions (the one that will be injected).
It is working but there are probably better ways to do it, as this is kind of a question and suggestion at the same time.
Note that this doesn't have anything to do with debugInfoEnabled in particular, it was just an example.
The text was updated successfully, but these errors were encountered:
I think it could be useful to have some mechanism to inject variables within angularjs logic according to our env. I know that we can pass in some properties from env configs using express and swig and those are indeed dependent in the current env. But today I was reading this part of the Angular docs and I wanted to set both
$compileProvider.debugInfoEnabled(false);
andng-strict-di="true"
only while in production.Im not sure if it is possible/correct/safe to set those angular vars the same way we do for the ones with express/swig, so in my app I ended up creating a module like this:
The
@@debugInfoEnabled
expression will be replaced usinggrunt-replace
task by matching the pattern@@
and then inject this module in the main mean module.And then I can access it this way for example:
The downside is that I need to have an extra dummy file with the matching expressions like showed above that will generate the file with the replaced expressions (the one that will be injected).
It is working but there are probably better ways to do it, as this is kind of a question and suggestion at the same time.
Note that this doesn't have anything to do with
debugInfoEnabled
in particular, it was just an example.The text was updated successfully, but these errors were encountered: