1
當應用程序處於生產模式時,我需要注入一個angularjs模塊依賴項。我正在使用requirejs來處理腳本加載。RequireJS production/dev variables
目前,我有一些,如果塊安裝在我的asp.net文件中設置像一個全局變量:
@if (!HttpContext.Current.IsDebuggingEnabled){
<script type="text/javascript">window.env = "production";</script>
}
,然後在我的javascript我做的:
if(window.env === "production"){
app.requires.push('templates-main');
}
是有一個首選的方法來處理這個?