angularjs - 带有 MVC 捆绑包的 OCLazyLoad
问题描述
我使用 MVC 捆绑来捆绑 JS 文件:
bundles.Add(new ScriptBundle("~/bundles/essentialjs").Include(
"~/Scripts/spa/features/exception/exceptionModule.js",
"~/Scripts/spa/features/exception/controllers/errorController.js"
));
我需要使用 OCLazyLoad 加载这些 MVC 包。我尝试了下面的代码,但找不到捆绑包的 404。
.state('test',
{
url: "/login",
templateUrl: "scripts/test.html",
resolve: {
plugins: ['$ocLazyLoad', function ($ocLazyLoad) {
console.log('oczload');
return $ocLazyLoad.load([
{ type: 'js', path: '~/bundles/essentialjs' }
]);
}]
}
})
问题似乎在这一行:
{ type: 'js', path: '~/bundles/essentialjs' }
解决方案
推荐阅读
- c# - 将字符串 UTC 时间解析回 DateTime
- microsoft-graph-api - 无法使用 todo-task API 在 Microsoft Teams 中查看其他人的待办事项列表或待办事项
- c++ - vs code 终端窗口显示文件位置。在 C-C++ 中
- php - 如果是工作日或周末,请检查日期并做某事
- python - 如何在 Python 中运行一个进程并捕获它接收到的所有内容(不仅仅是我给出的命令的结果)?
- python - 如何从不断出现在 python 中的图像中不断更新视频?
- pandas - 如何将元组绘制为 x 轴并绘制 y 轴上的列表
- java - 如何使用 nginx 代理更改主机 URL
- flutter - Flutter mobile_number 包中的异常
- react-native - tfjs-models 通用句子编码器的 embed() 仅在物理设备上中断