Github 页面不会在 AngularJS 1.x 网站上显示图像?

Github pages won't show images on AngularJS 1.x site?

我用 Angular 1.x 制作了一个简单的单页网站,它不会在 Github 页上加载我的图片。这是 link 到 github 页面的站点:

https://capozzic1.github.io/angular-car-spa-v2/

我已经检查了与此相关的其他 Whosebug 帖子,但似乎找不到答案。我只有 2 张图片要加载到一个简单的滑块上。这是我的指令 js 文件中的代码:

this.carData = [{
                class:'A4',
                name: "Audi A4",
                tagline: "The time is now.",
                img: "/img/big/car1.jpg"
                },
                {
                class:'A5',
                name: "Audi A5",
                tagline: "Do you like power?",
                img: "/img/big/car2.jpg"}
              ];

如果您想查看文件夹结构,这里是 link 到 repo:

https://github.com/capozzic1/angular-car-spa-v2

我还验证了这两个图像在存储库中都能正常工作。

您需要删除图片中的斜杠 url,因为您的网站未托管在根目录中。您需要提供正确的相对路径。将 json 更改为下面的

this.carData = [{
                class:'A4',
                name: "Audi A4",
                tagline: "The time is now.",
                img: "img/big/car1.jpg"
                },
                {
                class:'A5',
                name: "Audi A5",
                tagline: "Do you like power?",
                img: "img/big/car2.jpg"}
              ];