Using ng-include With IIS
Using ng-include With IIS
下面的ng-include标签适用于开发人员盒,但不适用于IIS网站,因为它在输出中不包括网站的名称
<div ng-include="'/app/feature/list.html'" />
在运行IISExpress的开发机器上,这将构建一个url: http://localhost:49716/app/feature/list.html,并且运行良好。
部署到IIS时,url为:http://server/app/feature/list.html。这不起作用,因为该站点被赋予了一个名称并在/site上提供服务。期望的url是http://server/site/app/feature/list.html。这将导致一个404和一个破碎的网站。
angular不应该构建相对于站点本身的真实路径吗?有没有一种方法可以让angular在不把它作为配置注入的情况下做到这一点?
我的问题是来自url的斜杠。斜杠表示绝对路径,而不是相对路径。这个ng-include工作:
<div ng-include="'app/feature/list.html'" />
相关文章:
- Fighting with FRP
- issue with FB.Event.subscribe
- geolocation-marker.js conflict with markerclusterer.js
- Angular 2.0 with JavaScript or TypeScript?
- 为什么不推荐使用“with”?是否有更好或其他方法可以“下降”到对象的命名空间
- WebComponentsJS with IE10
- 指令的模板必须只有一个根元素:With restrict E&替换true
- IIS动态HTTP响应标头
- timeago.js with datatable and PHP
- Ajax and Json with Rails
- errors with Javascript try catch
- how to split a string with ','
- Understanding Javascript scope with "var that = this&qu
- 显示IIS上javascript文件(SOAP请求)的XML响应
- Architecture for CPU intensive tasks with NodeJS & Socke
- How to declare a Map containing certain properties with flow
- 设置'这'在React with Inverse Data Flow中
- Unit-testing multiple use cases with Karma & Mocha.js
- Modify Javascript with C#
- Using ng-include With IIS