gpt4 book ai didi

javascript - ui 路由器未加载 rawgit 中的 View ,但在本地工作

转载 作者:行者123 更新时间:2023-12-03 07:36:54 24 4
gpt4 key购买 nike

这是存储库:

https://github.com/vipul-verma/naysa

如果您下载并在本地运行它,它就可以工作。

这是预览页面:

https://rawgit.com/vipul-verma/naysa/master/index.html

问题:Rawgit.com 仅显示菜单,它不加载 slider 和关于页面的 View 。

任何解决方案!!

最佳答案

你的 templateUrls 是绝对的,所以当 url 不是 root 时它会加载失败(在 rawgit 上也是如此)。它尝试加载 https://rawgit.com/partials/slider.html 而不是 https://rawgit.com/vipul-verma/naysa/master/partials/slider.html .

尝试改变

views: {
'viewSlider' : {
templateUrl: "/partials/slider.html"
},
'viewAbout' : {
templateUrl: "/partials/about.html"
}
}

views: {
'viewSlider' : {
templateUrl: "partials/slider.html" // <- remove slash on start
},
'viewAbout' : {
templateUrl: "partials/about.html" // <- remove slash on start
}
}

关于javascript - ui 路由器未加载 rawgit 中的 View ,但在本地工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35575147/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com