gpt4 book ai didi

angularjs - 为什么找不到我的图像根目录

转载 作者:数据小太阳 更新时间:2023-10-29 03:27:19 24 4
gpt4 key购买 nike

我正在使用带有 Angular 的 go-lang 以这种方法构建汽车 View :这是我的 main.go

router.GET("/shopping", carBaseController.CarsViewIndex)
router.GET("/images", galleryBaseController.GetImages)

在我的 Controller \cars.go 中

    func (controller CarController) CarsViewIndex(c *gin.Context) {
c.HTML(http.StatusOK, "carview.html", gin.H{
"title": "Car Page"})
}

func (controller GalleryController) GetImages(c *gin.Context) {
imageList := controller.galleryService.FindImages(&bson.M{})
c.JSON(http.StatusOK, &imageList)
fmt.Println(imageList)
}

在我的 carview.html 中

                                    <div class="row mix-grid" ng-init="GetAllImages()" >
<div class="col-md-3 mix photography" ng-repeat="image in allimages">
<div class="hover-effect" >
<div class="img" ><img src="imagesT/gallery/Thumb/{{image.imagename}}" alt=""
class="img-responsive"/></div>
<div class="info"><h3>Manage Images</h3><a href="#"
class="mix-link"><i
class="glyphicon glyphicon-link"></i></a><a
href="imagesT/gallery/{{image.imagename}}" data-lightbox="image-1"
data-title="Image 1" class="mix-zoom"><i
class="glyphicon glyphicon-search"></i></a></div>
</div>
this is the site fo cars
<a class="btn btn-default" href="carinfo">Learn More
<span class="glyphicon glyphicon-chevron-right"></span></a>
</div>

</div>

当我输入 http://localhost:3030/shopping一切正常,但我发现了这个错误

    "NetworkError: 404 Not Found -
http://localhost:3030/imagesT/gallery/Thumb/%7B%7Bimage.imagename%7D%7D"

我不知道为什么在一切正常的情况下会发生这个错误,这就是我用 firbug 发现的:

<img class="img-responsive" alt="" src="imagesT/gallery/Thumb/2016-chevrolet-cruze-spied-completely-uncovered-news-car-and-driver-photo-658949-s-217x132.jpg">

最佳答案

你试过用 ng-src 而不是 src 吗?

关于angularjs - 为什么找不到我的图像根目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36807433/

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